Level 61
abort_if($role, Response::HTTP_FORBIDDEN, 'You shall not pass');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
public function __construct()
{
$this->middleware('role:General Admin|ER Admin', ['only' => ['addAppraisal','performanceappraisal','assignflow','appraisalTemplateassignflowshow','storeFlow','statusappraisal','escalation','escalationShow','escalationStore','showAppraisalTemplate']]);
}
I have 8 roles in my application and i want to give access to these methods to 7 of those roles. Is there any option to RESTRICT method for 1 role in constructor?
Please or to participate in this conversation.