mardi 28 juillet 2020

where does laravel can function for user object define?

i am working on a laravel project .almost i see in each controller these line format :

!auth()->user()->can('something (differ from each controller to other one)')

but in my php editor it says method {can} not found for this object. so i try to found method can and not found it .even i edit __Call magic method to see if when can method is calling does magic function run but i know it never run for can function.so how it is possible to link function to object when it is not defined in class and its all mother class.and where does can function locate?i search and i see laravel has some policy for authorize users but yet i don not know how can function link to user object without define in classes and even magic method does not run .and how can i develope these type of function (for authorizing in laravel and change policy)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire