You want to log a user on with code.
Instead of the normal way using filters, you need to validate a user's credentials and optionally log them in.
You must provide the credentials.
$success = Auth::attempt(['username' => 'me', 'password' => 'pass']);
This will attempt to log the user on using
username = 'me' and 'password' == Hash::make('pass'). If successful,
true is returned and the user is logged in.
The second argument specifies whether or not to set the "remember me" cookie. The default value of this second argument is
$success = Auth::attempt($credentials, true);
true, the remember me cookie will be set.
If you only want to validate and not log the user in, you can pass a third option. The default for this third option is
$success = Auth::attempt($credentials, false, false);
Nothing to discuss.