2017 © Pedro Peláez
 

library sentinel

An implementation of the Sentry User Manager for Laravel.

image

rydurham/sentinel

An implementation of the Sentry User Manager for Laravel.

  • Thursday, July 26, 2018
  • by rydurham
  • Repository
  • 26 Watchers
  • 328 Stars
  • 24,433 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 88 Forks
  • 13 Open issues
  • 85 Versions
  • 2 % Grown

The README.md

Sentinel: Sentry Implementation for Laravel

Build Status Total Downloads License, (*1)

This package provides an implementation of Sentry 2 for Laravel. By default it uses Bootstrap 3.0, but you can make use of whatever UI you want. It is intended to be a very simple way to get up and running with User access control very quickly. For simple projects you shouldn't need to do much more than drop it in and dial in the configuration., (*2)

The cartalyst/sentry auth package has been deprecated. If you are using it in production you should upgrade to cartalyst/sentinel. This package will also eventually be deprecated. Do not use this package if you are starting a fresh application., (*3)

Important There are two PHP packages named "Sentinel". This is rydurham/sentinel, not cartalyst/sentinel. The key difference is that this package is intended to be an implementation of Sentry v2, whereas Cartalyst released what would have been Sentry v3 under the name cartalyst/sentinel. The instructions below are specifically for rydurham/sentinel, make sure you are using the right package before proceeding., (*4)

If you are looking for a quick way to get up and running with cartalyst/sentinel. I have created a bridge package that may be helpful. If you are starting a new Laravel project, I recommend using that package instead of this one., (*5)

Releases There are several versions of this package, each intended for different versions of the Laravel framework., (*6)

Laravel Version Sentinel Version Packagist Branch
7.0.* 4.0.* "rydurham/sentinel": "~4.0"
8.0.* 5.0.* "rydurham/sentinel": "~5.0"
9.0.* 6.0.* "rydurham/sentinel": "~3.0"

Laravel 5 Instructions

Install the Package Via Composer:, (*7)

$ composer require rydurham/sentinel

Make sure you have configured your application's Database and Mail settings., (*8)

This package uses "package discovery" to automatically register it's service provider with your application., (*9)

Register the Middleware in your app/Http/Kernel.php file:, (*10)

protected $routeMiddleware = [
    // ..
    'sentry.auth' => \Sentinel\Middleware\SentryAuth::class,
    'sentry.admin' => \Sentinel\Middleware\SentryAdminAccess::class,
    'sentry.member' => \Sentinel\Middleware\SentryMember::class,
    'sentry.guest' => \Sentinel\Middleware\SentryGuest::class,
];

Publish the Views, Assets, Config files and migrations:, (*11)

php artisan sentinel:publish

You can specify a "theme" option to publish the views and assets for a specific theme:, (*12)

php artisan sentinel:publish --theme="foundation"

Run php artisan sentinel:publish --list to see the currently available themes., (*13)

Run the Migrations Be sure to set the appropriate DB connection details in your .env file., (*14)

Note that you may want to remove the create_users_table and create_password_resets_table migrations that are provided with a new Laravel 5 application., (*15)

php artisan migrate

Seed the Database:, (*16)

php artisan db:seed --class=SentinelDatabaseSeeder

More details about the default usernames and passwords can be found here., (*17)

Set a "Home" Route., (*18)

Sentinel requires that you have a route named 'home' in your routes.php file:, (*19)

// routes/web.php
Route::get('/', function () {
    return view('welcome');
})->name('home');

Basic Usage

Once installed and seeded, you can make immediate use of the package via these routes: * yoursite.com/login * yoursite.com/logout * yoursite.com/register * yoursite.com/users - For user management. Only available to admins * yoursite.com/groups - For group management. Only available to admins., (*20)

Sentinel also provides middleware which you can use to prevent unauthorized access to your application's routes & methods., (*21)

  • Sentinel\Middleware\SentryAuth - Require users to have an active session
  • Sentinel\Middleware\SentryAdminAccess - Block access for everyone except users who have the 'admin' permission.
  • Sentinel\Middleware\SentryMember - Limit access to members of a certain group. The group name is case sensitive. For example:
// app\Http\Controllers\ExampleController.php
public function __construct()
{
    $this->middleware('sentry.member:Admins');
}
  • Sentinel\Middleware\SentryGuest - Redirect users who have an active session

Advanced Usage

This package is intended for simple sites but it is possible to integrate into a larger application on a deeper level: * Turn off the default routes (via the config) and manually specify routes that make more sense for your application * Create a new User model that extends the default Sentinel User Model Sentinel\Models\User. Be sure to publish the Sentinel and Sentry config files (using the sentinel:publish command) and change the User Model setting in the Sentry config file to point to your new user model. * Inject the SentryUserRepository and/or the SentryGroupRepository classes into your controllers to have direct access to user and group manipulation. You may also consider creating custom repositories that extend the repositories that come with Sentinel., (*22)

It is not advisable to extend the Sentinel controller classes; you will be better off in the long run creating your own controllers from scratch., (*23)

Using Sentinel in Tests

If you find yourself in the situation where you want to do tests with user logged in, go to your ``` tests/TestCase.php `` and add this method:, (*24)


use Illuminate\Events\Dispatcher; /** * Login to sentry for Testing purpose * @param $email * @return void */ public function sentryUserBe($email='admin@admin.com') { $user = \Sentry::findUserByLogin($email); \Sentry::login($user); (new dispatcher)->dispatch('sentinel.user.login', ['user' => $user]); }

You can then start testing your application with user logged in, as such:, (*25)

class ExampleTest extends TestCase
{
    /**
     * Dashboard functional test example.
     *
     * @return void
     */
    public function testDashboardPage()
    {
        $this->sentryUserBe('admin@admin.com');
        $this->visit('/dashboard')
             ->see('dashboard');
    }
}

Documentation & Questions

Check the Wiki for more information about the package: * Configuration Options * Events & Listeners * Seed & Migration Details * Default Routes, (*26)

Any questions about this package should be posted on the package website., (*27)

Localization

Sentinel has been translated into several other languages, and new translations are always welcome! Check out the Sentinel Page on CrowdIn for more details., (*28)

The Versions

26/07 2018

dev-master

9999999-dev

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

26/07 2018

v2.8.1

2.8.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

14/02 2018

v2.8.0

2.8.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

01/09 2017

v2.7.0

2.7.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

12/02 2017

v2.6.2

2.6.2.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

28/01 2017

v2.6.1

2.6.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

28/01 2017

v2.6.0

2.6.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

18/09 2016

5.3.x-dev

5.3.9999999.9999999-dev

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

18/09 2016

v2.5.0

2.5.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/07 2016

5.1.x-dev

5.1.9999999.9999999-dev

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/07 2016

v2.2.7

2.2.7.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

18/07 2016

dev-analysis-87W106

dev-analysis-87W106

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

18/07 2016

v2.2.6

2.2.6.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

30/06 2016

v2.4.1

2.4.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

15/06 2016

dev-analysis-zGPNkr

dev-analysis-zGPNkr

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

15/06 2016

v2.4.0

2.4.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

13/02 2016

v2.3.5

2.3.5.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/01 2016

v2.3.4

2.3.4.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/01 2016

v2.3.3

2.3.3.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/01 2016

v2.3.2

2.3.2.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/01 2016

v2.3.1

2.3.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/01 2016

v2.3.0

2.3.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

13/11 2015

v2.2.5

2.2.5.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

04/11 2015

dev-analysis-zOollz

dev-analysis-zOollz

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/08 2015

dev-analysis-862gW8

dev-analysis-862gW8

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

17/08 2015

dev-analysis-8KPveX

dev-analysis-8KPveX

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

17/08 2015

v2.2.4

2.2.4.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/07 2015

v2.2.3

2.2.3.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

20/07 2015

v2.2.2

2.2.2.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

13/06 2015

v2.2.1

2.2.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

12/06 2015

v2.2.0

2.2.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

11/05 2015

v2.1.7

2.1.7.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

04/05 2015

1.4.x-dev

1.4.9999999.9999999-dev

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

04/05 2015

v1.4.27

1.4.27.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

03/04 2015

v2.1.6

2.1.6.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

03/04 2015

v2.1.5

2.1.5.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

01/04 2015

v2.1.4

2.1.4.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

31/03 2015

v2.1.3

2.1.3.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

31/03 2015

v1.5.0

1.5.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

22/03 2015

v2.1.2

2.1.2.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

15/03 2015

v1.4.26

1.4.26.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

15/03 2015

v2.1.1

2.1.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

11/03 2015

v2.1.0

2.1.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

28/02 2015

v2.0.1

2.0.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/02 2015

2.0.x-dev

2.0.9999999.9999999-dev

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/02 2015

dev-develop

dev-develop

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

27/02 2015

v2.0.0

2.0.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

11/02 2015

v2.0.0a6

2.0.0.0-alpha6

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

10/02 2015

v2.0.0a5

2.0.0.0-alpha5

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

09/02 2015

v2.0.0a4

2.0.0.0-alpha4

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

08/02 2015

v2.0.0a3

2.0.0.0-alpha3

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

16/01 2015

v2.0.0a2

2.0.0.0-alpha2

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

14/01 2015

v1.4.25

1.4.25.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

09/01 2015

v1.4.24

1.4.24.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

05/01 2015

v2.0.0a1

2.0.0.0-alpha1

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

26/12 2014

v1.4.23

1.4.23.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel auth sentry

18/12 2014

v1.4.22

1.4.22.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

18/12 2014

v1.4.21

1.4.21.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

21/11 2014

v1.4.20

1.4.20.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

15/08 2014

v1.4.19

1.4.19.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

15/08 2014

v1.4.18

1.4.18.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

15/08 2014

v1.4.17

1.4.17.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

11/08 2014

v1.4.16

1.4.16.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

19/07 2014

v1.4.14

1.4.14.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

07/07 2014

v1.4.13

1.4.13.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

13/06 2014

v1.4.12

1.4.12.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

11/06 2014

v1.4.11

1.4.11.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

04/06 2014

v1.4.10

1.4.10.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

02/06 2014

v1.4.9

1.4.9.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

30/05 2014

v1.4.8

1.4.8.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

28/05 2014

v1.4.7

1.4.7.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

24/05 2014

v1.4.6

1.4.6.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

21/05 2014

v1.4.5

1.4.5.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

laravel auth sentry

13/05 2014

v1.4.4

1.4.4.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

07/05 2014

v1.4.3

1.4.3.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

17/04 2014

v1.4.2

1.4.2.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

17/03 2014

v1.4.1

1.4.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

02/03 2014

v1.4

1.4.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

21/02 2014

v1.3.1

1.3.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

14/02 2014

v1.3

1.3.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

11/02 2014

v1.2.1

1.2.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

08/02 2014

v1.2.0

1.2.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

05/02 2014

v1.1.1

1.1.1.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

04/02 2014

v1.1.0

1.1.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry

01/02 2014

v1.0.0

1.0.0.0

An implementation of the Sentry User Manager for Laravel.

  Sources   Download

BSD-3-Clause

The Requires

 

by We Are Base

laravel auth sentry