Closed Cyrille37 closed 12 months ago
I also try @if( Auth::guard( config('platform.guard') )->user()->can('platform.index'))
but it say Auth guard [platform.guard] is not defined.
Ok, I found the solution to make a link to Orchid platform from Application menu :
@if( Auth::user()->hasAccess('platform.index'))
<x-nav-link href="{{ route('platform.index') }}" :active="request()->routeIs('platform.index')">
{{ __('Admin') }}
</x-nav-link>
@endif
Method hasAccess()
is defined in Trait Orchid\Access\UserAccess
that is used in Orchid\Platform\Models\User
that our application's User extends.
So simple :-)
Hello Thanks a lot for this great tool <3
Orchid platform is at
/admin
and I want to display or not a link to this in the laravel application, based on permission or gate or ???.I tried in an application blade view different authorization strings like
Auth::user()->can('platform')
and'platform.index'
and'platform.main'
but none work.Is exist a string that Laravel Authorization can test ? I did not find in the documentation. Perhaps the solution can be added in configuration section.
Thanks & cheers :-)