Today we are going to discuss about how to do authentication and authorization with laravel 4. Before going to this, we need to disccuss about one most popular package which is “Sentry” .
About and Features of “Sentry” :
Sentry is authentication and authorization system based on PHP 5.3 + .
- It allows custom configuration for authentication (Ex: login by username or email)
- Activation of user (optional)
- Groups and group permissions
- “Remember me”
- User suspension
- Login throttling (optional)
- User banning
- Password resetting
- User data
install this package via composer. For example first you must add following lines into your composer.json file
then run the composer update command via terminal or command line
If you haven’t yet, make sure to require Composer’s autoload file in your app root to autoload the installed packages.
Sentry manual : https://cartalyst.com/manual/sentry
For some sample code : https://github.com/rydurham/L4withSentry