romanbican / roles

Powerful package for handling roles and permissions in Laravel 5
MIT License
1.16k stars 296 forks source link

ErrorException in HasRoleAndPermission.php line 104 #187

Closed wstudios closed 8 years ago

wstudios commented 8 years ago

I am using laravel 5.3, I added the fixes in the pull requests so everything works great. The issue I have is when applying a role middleware to a route.

I am using this: Route::group(['prefix' => 'office', 'middleware' => 'role:admin'], function()

It however throws the above error, here is some more on the error.

at HandleExceptions->handleError('8', 'Trying to get property of non-object', '......./vendor/bican/roles/src/Bican/Roles/Traits/HasRoleAndPermission.php', '104', array('key' => object(Role), 'value' => '0', 'role' => 'admin')) in HasRoleAndPermission.php line 104

Thanks for any help.

nikolaynesov commented 8 years ago

@wstudios #189 this should be the fix. Let me know if you still have any problems.

wstudios commented 8 years ago

Thank you! Applying the fixes works great.