Skip to content
/ Sentinel Public
forked from rydurham/Sentinel

A Sentry implementation package for Laravel 4

Notifications You must be signed in to change notification settings

el2ro/Sentinel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentinel: Fork - few important changes to me

  • adding Finnish Translation
  • allow password config that does not send password over email
  • busy, took a fast track, hope to fix those and push to rydurham branch

Sentinel: Sentry Implementation for Laravel 4

This pacakge provides an implementation of Sentry 2 for Laravel 4. By default it uses Bootstrap 3.0, but you can make use of whatever UI you want.

This package is based on my L4withSentry demo repo.

Instructions

Add this package to your composer.json file:

"require": {
    "laravel/framework": "4.1.*",
    "rydurham/sentinel": "1.*"
},

Run Composer Update

Make sure you have configured your app's Database and Mail settings.

Add the Service Provider to your app/config/app.php file:

'providers' => array(
     ...
    'Sentinel\SentinelServiceProvider',  
    )

Run the Migrations:

php artisan migrate --package=rydurham/sentinel

Seed the Database:

php artisan db:seed --class="SentinelDatabaseSeeder"

Publish the package assets:

php artisan asset:publish rydurham/sentinel

Set a "Home" Route. This package requires that you have a named 'home' route in your routes.php file:

// Set Home Route
 Route::get('/', array('as' => 'home', function()
{
    return View::make('home');
}));

Optional: Publish Views

php artisan view:publish rydurham/sentinel

Optional: Publish Configuration

php artisan config:publish rydurham/sentinel

The config file will allow you to control many aspects of Sentinels operation. Take a look to see what options are available.

Usage: Filters and Routes

Once installed, Sentinel adds a series of routes for User interaction. You will need to add links to these routes in your app's layouts.

  • yoursite.tld/login
  • yoursite.tld/logout
  • yoursite.tld/register
  • yoursite.tld/users - For user management. Only available to admins
  • yoursite.tld/groups - For group management. Only available to admins.

Sentinel also provides these filters which you can use to prevent unauthorized access to your app's routes & methods.

  • Sentinel\auth - Require users to be successfully logged in
  • Sentinel\inGroup:Admins - Block access to all but members of the Admin group. If you create your own groups, you can use it as such: Sentinel\inGroup:[YourGroup].

Documentation & Questions

Check the Wiki for more information about the package:

  • Events & Listeners
  • Seed & Migration Details
  • Default Routes
  • Basic API Info

Any questions about this package should be posted on the package website.

To Do

  • Set up testing with Travis
  • Increase test coverage - currently the tests are very limited.
  • Add More languages?

History

  • 1.4.2 Added new config options: Default User groups and Post Login redirect location.
  • 1.4.1 Bug fixes.
  • 1.4 Added Event triggers to allow users to set up custom functionality.
  • 1.3.1 Moved Custom Validation messages into Language file.
  • 1.3 Added configuration option to turn Registration on or off.
  • 1.2.1 Added Redirect::guest()
  • 1.2 Added config option for default views, fixed filter namespacing, added Italian language files.
  • 1.1 Added Config options. Moved named routes into 'Sentinel' namespace.
  • 1.0 Initial version. A direct port of L4withSentry into package form.

Thanks

About

A Sentry implementation package for Laravel 4

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.0%
  • JavaScript 1.0%