Answer the question
In order to leave comments, you need to log in
How does the facade mechanism work in laravel?
Hey! Please tell me how the mechanism for accessing static methods is arranged using laravel as an example.
For example, there is a php file routes.php and it uses the Route::get/post/put/delete facade... How does it work? In a sense, the Route class uses its own namespace and when require routes.php it does not have the use keyword to access the class and its methods. Routes are simply written there by directly referring to the Route class. Please tell me with an example how it works, because, as you know, when importing (require), namespaces are not inherited.
Answer the question
In order to leave comments, you need to log in
For me, it’s not worth going into the details of how the tools work, the main thing is to know how to use them. In this case, in the route you also specify the name of the controller and method, that's how he understands the request to which method it is addressed.
Route::post('/report', '[email protected]')
Look carefully here, according to the logic, it's already clear where the request will be knocked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question