Laravel éloquent éloquent de DB
$res=User::where('id',$id)->delete();
Disturbed Dunlin
$res=User::where('id',$id)->delete();
use App\Models\Flight;
$flight = Flight::find(1);
$flight->delete();
public function destroy($id){
$res=User::find($id)->delete();
if ($res){
$data=[
'status'=>'1',
'msg'=>'success'
];
}else{
$data=[
'status'=>'0',
'msg'=>'fail'
];
return response()->json($data);