fixed database issue

This commit is contained in:
Aqeeb Imtiaz Harun
2018-06-08 11:35:47 +08:00
parent 6797f63383
commit f58bd69d76
3 changed files with 283 additions and 326 deletions
+2 -58
View File
@@ -24,18 +24,6 @@ class ContactController extends Controller
return response()->json($contact, 200);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
@@ -67,51 +55,6 @@ class ContactController extends Controller
return response()->json($contact, 201);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
// $contact = Contact::find($id);
// if (!$contact)
// {
// return response()->json(['message'=>'ID not found'],200);
//
// }
//
// $contact->ff_id=$request->input('ff_id');
//
//
// $contact->save();
// return response()->json(['contact'=>$contact],200);
}
/**
* Remove the specified resource from storage.
*
@@ -120,7 +63,8 @@ class ContactController extends Controller
*/
public function destroy($id)
{
$contact=Contact::find($id);
$contact = Contact::where("user_id", Auth::user()->id)->where('id', $id)->first();
//$contact=Contact::find($id);
$contact->delete();
return response()->json($contact, 204);