lundi 8 octobre 2018

how to delete users generated by make:auth laravel

hello everyone i have some troubles while deleting or updating any users in the list, the users don't want to be deleted ,the error is "Class 'App\Role' not found" and i have no class role.

if someone know some idea about delete user generated by make:auth , i will be grateful this is the code

the route

Route::POST('destroyUser','UserController@destroy')->name('destroyUser');

the controller

public function destroy(Request $request)  {

        $user= User::findOrFail($request->user_id);
       $user->delete();
       Session::flash('message','l\'utilisateur '.$user->name.' a été supprimé avec succès');
       return back();

                  }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire