vmitchell85
1 year ago

Authorization Timeout When Using Gates/Bouncer

Posted 1 year ago by vmitchell85

My Setup:

  • Laravel 5.7
  • Bouncer
  • Developing a composer package

I'm having some odd behavior where an authorization check takes way too long to come back which results in a max execution time error. This check works just fine on the user with an id of 1 but when I check for user id 2 it times out.

Here is the original code from the blade file (in the composer package):

@if (auth()->user()->can('read', \App\User::class))
                <a href="{{route('my-package::users.index')}}" class="py-2 no-underline text-grey-light">Users</a>
            @endif

I ran it in tinker to see if it would do the same thing and it does: https://d.pr/i/j6jx1D

Thanks in advance for any tips or answers.

Please sign in or create an account to participate in this conversation.