This will depend on the version of Laravel you are using.
Laravel 5.2
You need to add the property $loginView
to class AuthController
.
So:
protected $loginView = 'nome_da_minha_view';
In the source code of trait
called Illuminate\Foundation\Auth\AuthenticatesUsers
, there is a method called showLoginForm
, which is written like this:
/**
* Show the application login form.
*
* @return \Illuminate\Http\Response
*/
public function showLoginForm()
{
$view = property_exists($this, 'loginView')
? $this->loginView : 'auth.authenticate';
if (view()->exists($view)) {
return view($view);
}
return view('auth.login');
}
Note that if the loginView
property exists in the current class (in this context it would be AuthController
), the view used will be the one defined in this property, if view
also exists (according to the view()->exists()
check).
Laravel 5.3 and 5.4
You simply need to override the method named showLoginForm
in the authentication class and return to view
desired.
public function showLoginForm()
{
return view('minha_view_personalizada');
}
There is yet another hint, which is to create the method called getLogin
returning view
. It will have the same effect as above with showLoginForm
.