Authentication and Authorization with Laravel 4

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)
  • Authorization
  • Activation of user (optional)
  • Groups and group permissions
  • “Remember me”
  • User suspension
  • Login throttling (optional)
  • User banning
  • Password resetting
  • User data

and more….


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 :

For some sample code :