Level 20
On which line do you have the error ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Guys , I use to make a muth authentication like this -
https://laracasts.com/lessons/users-and-roles
but now in Laravel 5.6 , is not working this type of Authentication , maybe somethis has changed .
In AuthServiceProvider , I have this code -
use Illuminate\Support\Facades\Gate as GateContract;
public function boot(GateContract $gate)
{
$this->registerPolicies();
foreach ($this->getPermissions() as $permission){
$gate->define($permission->title , function($user) use ($permission){
return $user->hasRole($permission->roles);
});
}
}
protected function getPermissions(){
return UserPermission::with('roles')->get();
}
but is giving this error
Class 'App\Providers\Gate' not found
dows some one knows what is happenig ?
Please or to participate in this conversation.