Support the ongoing development of Laravel.io →
Authentication Security Views
Last updated 2 years ago.
0

This may help. As stevemo/cpanel uses Cartalyst Sentry package. You can try with following method.

$user = Sentry::getUser();
if ( $user->hasAccess('groupname') )
{
     //Enable button
} else { 
    //Disable button
}

The first line will get the current user and next line will check for the group permission. For more detail Check Sentry.

Last updated 2 years ago.
0

use this in your view

@if(Auth::check())
                         
        <button type="button" disabled="disabled">Disabled button</button>
 @else
       <button type="button">Enabled button</button></p>
@endif
Last updated 2 years ago.
0

Thanks! Sikandhar.

Thanks swgj19. but stevemo/cpanel uses Sentry.

Last updated 2 years ago.
0

Whoops, did not know that. Glad @Sikandhar had the right approach.

Last updated 2 years ago.
0

Hi Laravel Genius ! I am in efforts to make a simple Laravel Admin section for anyone to integrate in their Website. Please contribute your efforts laraadmin - on GitHub Regards, Rizwan Ranjha

0

Sign in to participate in this thread!

Eventy

Your banner here too?

djhunx djhunx Joined 10 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.