Support the ongoing development of Laravel.io →
Authentication Forms Validation
Last updated 1 year ago.
0

@tut1,

Create groups and permissions using sentry.

if its, check the admin group :

@if(Sentry::getUser()->inGroup(Sentry::getGroupProvider()->findByName('admin')))

    --- statements ---

@endif

refers : https://cartalyst.com/manual/sentry/2.1

0

@kumarramalingam - Sentry is for Laravel 4, @tut1 is asking about Laravel 5.

There's no built-in groups functionality within Auth of Laravel, so you can do whatever you want - add a field type into your users table and then access it by Auth::user()->type to check permissions.

0

@PovilasKorop

Sentry support in laravel 5.

  1. There is no official support right now for Sentry in L5. They state this right on their website. They are working on it however.

  2. Add the following to your composer.json file in the require section.

Add the following to the autoload section.


"cartalyst/sentry": "dev-feature/laravel-5",
"illuminate/html": "~5.0"

It should look something like:


"require": {
    "laravel/framework": "5.0.*",
    "cartalyst/sentry": "dev-feature/laravel-5",
    "illuminate/html": "~5.0"
},
"require-dev": {
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database",
        "app/Classes",
        "app/Http/Controllers",
        "app/Models"

  1. (Presuming linux with no aliases) Run php composer.phar dump-autoload then php composer.phar update
0

@kumarramalingam - yes, I've seen it, but I wouldn't advice to use library without official support, feels "hacky" to me (although it does work, I agree).

Cartalyst went the other way - built Sentinel, and this week they even launched Indiegogo campaign to make it open-source https://www.indiegogo.com/projects/sentinel-open-source#/story (I wonder how did they come up with that 25k price?)

So I wouldn't rely on their "they are working on it" phrase, they are commercial organization and Sentry doesn't make them money, so would doubt they are keen to invest extra in supporting L5 - they would rather move users to paid Sentinel.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

tut1 tut1 Joined 26 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.