06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Authentication 215<br />

Specifying A Guard<br />

When attaching the auth middleware to a route, you may also specify which guard should be used<br />

to perform the authentication:<br />

1 Route::get('profile', [<br />

2 'middleware' => 'auth:api',<br />

3 'uses' => 'ProfileController@show'<br />

4 ]);<br />

The guard specified should correspond to one of the keys in the guards array of your auth.php<br />

configuration file.<br />

Authentication Throttling<br />

If you are using Laravel’s built-in AuthController class, the Illuminate\Foundation\Auth\ThrottlesLogins<br />

trait may be used to throttle login attempts to your application. By default, the user will not be able<br />

to login for one minute if they fail to provide the correct credentials after several attempts. The<br />

throttling is unique to the user’s username / e-mail address and their IP address:<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!