Latest

Tuesday, July 11, 2017

forceDelete bind id with null

Asked by: joy


I am using laravel 5.2 and want to delete user from table, but when i use forceDelete() it doesn't remove the record!

My code :

public function deleteUser(Request $request)
{
     $user=userModel::where('id','=',$request->id)->first();
     if($user->forceDelete())
     {
        echo $request->id;
     }
     else
     {
        echo "0";
     }
}

When i check query executed by forceDelete() it shows following : enter image description here



Source

No comments:

Post a Comment

Adbox