laravel - How to deny access to certain routes / views for users -


i trying deny access users other 1 id=1 (in case it's admin) 'cpanel' (admin panel) view. trying achieve acl, somehow think not correct way.

this want in pseudocode version

if (isadmin())     renderpage() else     print "you not allowed view page" 

reading documentation found line declared in custom controller

$this->authorize('update', $post); 

where 'update' ability defined elsewhere, , $post seems model (use app\post) don't know how implement. don't think laravel's documentation covers how implement models authorization.

how can authorize view? it's laravel 5.2


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -