Laravel Authentication

Laravel 5.3 change login path and prevent registration

Prevent that /login is the default path for login Thanks to Stackoverflow. Go to your routes/web.php And change: Auth::routes(); Into: // Login Route::group([‘middleware’ => [‘web’]], function() { Route::get(‘login-new-address’, [‘as’ => ‘login’, ‘uses’ => ‘Auth\LoginController@showLoginForm’]); Route::post(‘login-new-address’, [‘as’ => ‘login.post’, ‘uses’ => ‘Auth\LoginController@login’]); Route::post(‘logout-new-address’, [‘as’ => ‘logout’, ‘uses’ => ‘Auth\LoginController@logout’]); }); // Registration Routes… Route::get(‘register’, [‘as’ => […]

Laravel 5.3 change login path and prevent registration Read More »

Laravel 5.1 logout custom message and redirect to previous page

When you’re logging out in Laravel 5 and 5.1 the AuthenticatesUsers is called and the getLogout method. Since, it’s in the Illuminate directory it’s not nice to write in this file directly. It’s better to rewrite the getLogout method from an Auth\AuthController. Normally AuthCntroller, it might use this traits: use AuthenticatesAndRegistersUsers, ThrottlesLogins; Now we’ll rename

Laravel 5.1 logout custom message and redirect to previous page Read More »

Scroll to Top