lundi 7 décembre 2020

Does Laravel Instantiate a new controller instance every time a Route Endpoint is 'requested'?

The only similar answer I found was this one, but it relates to ASP.NET.

Was wondering if Laravel does something similar or the same, for I was wanting to test the controller instance used by the Route endpoint.

Is it generated before the endpoint is used? And if so, any idea whether it is posible to acquire that instance? (For mocking or changing values in it? For in testing, I would really like to use the Route Endpoint and not a generic controller instance to simulate "real world conditions").

Aucun commentaire:

Enregistrer un commentaire