mardi 26 décembre 2017

why did not logout after user delete from the account in Laravel 5.2

In My laravel application I have option to user to delete there accounts.

userController

public function destroy($id)
{
        $users = User::findOrFail($id);
        $users->delete();
        Auth::logout();
        return Auth::logout();
}

this is delete button from blade file,

<a href="/" class="editInline" onclick="return confirm('Are you sure to want to delete this Collaborator?')"><i clas
                      s="glyphicon glyphicon-trash"></i>Delete</a>

and route

Route::get('/users/{id}', [
    'uses' => 'UserController@destroy',
]);

but after user delete, My system did not reditect home directory (logout). it is stop with following url in localhost

http://localhost:8000/users/5

but I need redirect my system to the home or login page. how can I do this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2C8p68N
via IFTTT

Aucun commentaire:

Enregistrer un commentaire