I am using policies in my application. And for example, one user has a role customer-role. This customer-role has the customer.view permission. and in my customer policy I am checking like this.
public function view(User $user)
{
return $user->hasAccess('customer.view');
}
And from getcustomer request class:
public function authorize()
{
return Gate::allows('view', 'App\Models\Customer') ? true : false;
}
But this always returns false. Please someone help me here as am new to Laravel.