-1

I'm using spatie/laravel-permission to handle roles. I installed the package through composer did the migrations, and added the service provider in my config/app.php file, created some roles and everything fine, but when i'm going to use the blade directive @hasanyrole for example:

@hasanyrole('Profesional')

    @include('calendar.modal_appointment', ['order_details' => $order_details])

@endhasanyrole

It throws this error:

Call to undefined method App\User::hasAnyRole()
apokryfos
  • 38,771
  • 9
  • 70
  • 114
Santiago Ramirez
  • 167
  • 1
  • 3
  • 14

1 Answers1

1

Had to add use Spatie\Permission\Traits\HasRoles; and use HasRoles; on my User model that fixed the problem

Santiago Ramirez
  • 167
  • 1
  • 3
  • 14