06.10.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Upgrade Guide 27<br />

Once you have updated the file with a fresh copy, set your authentication configuration options<br />

to their desired value based on your old configuration file. If you were using the typical, Eloquent<br />

based authentication services available in Laravel 5.1, most values should remain the same.<br />

Take special note of the passwords.users.email configuration option in the new auth.php configuration<br />

file and verify that the view path matches the actual view path for your application, as the<br />

default path to this view was changed in Laravel 5.2. If the default value in the new configuration<br />

file does not match your existing view, update the configuration option.<br />

Contracts<br />

If you are implementing the Illuminate\Contracts\Auth\Authenticatable contract but are not<br />

using the Authenticatable trait, you should add a new getAuthIdentifierName method to your<br />

contract implementation. Typically, this method will return the column name of the “primary key”<br />

of your authenticatable entity. For example: id.<br />

This is unlikely to affect your application unless you were manually implementing this interface.<br />

Custom Drivers<br />

If you are using the Auth::extend method to define a custom method of retrieving users, you should<br />

now use Auth::provider to define your custom user provider. Once you have defined the custom<br />

provider, you may configure it in the providers array of your new auth.php configuration file.<br />

For more information on custom authentication providers, consult the full authentication documentation.<br />

Redirection<br />

The loginPath() method has been removed from Illuminate\Foundation\Auth\AuthenticatesUsers,<br />

so placing a $loginPath variable in your AuthController is no longer required. By default, the trait<br />

will always redirect users back to their previous location on authentication errors.<br />

Authorization<br />

The Illuminate\Auth\Access\UnauthorizedException has been renamed to Illuminate\Auth\Access\Authoriza<br />

This is unlikely to affect your application if you are not manually catching this exception.<br />

Collections<br />

Eloquent Base Collections<br />

The Eloquent collection instance now returns a base Collection (Illuminate\Support\Collection)<br />

for the following methods: pluck, keys, zip, collapse, flatten, flip.

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

Saved successfully!

Ooh no, something went wrong!