0

I've got a FormRequest class set up that is doing

public function authorize()
{
    return Auth::user()->hasPermissionTo('can update users');
}

however it is throwing an exception

the exception

However in my database the permission definately exists

image of database

Is there some form of naming convention I need to be using or something I could be doing wrong?

Thanks

apokryfos
  • 38,771
  • 9
  • 70
  • 114
owenmelbz
  • 6,180
  • 16
  • 63
  • 113

2 Answers2

1

Try clearing Laravel's cache, this can happen if permissions are added without being picked up by the cache.

Tudor
  • 1,798
  • 2
  • 12
  • 21
0

As per @Tudor's suggestion try running php artisan cache:clear in your terminal to clear laravel cache

~Regards

Ngugi Kiarie
  • 1,353
  • 11
  • 9