Create groups and permissions using sentry.
if its, check the admin group :
@if(Sentry::getUser()->inGroup(Sentry::getGroupProvider()->findByName('admin')))
--- statements ---
@endif
@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.
Sentry support in laravel 5.
There is no official support right now for Sentry in L5. They state this right on their website. They are working on it however.
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"
@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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community