I'm starting a fresh Laravel 4 application for the first time and one of the things I notice is that there is some magic going on when I follow the quick start guide. It suggests things like this to set up routes:
Route::get(...)
But when I went to find the static get
function in the \Illuminate\Routing\Route
class it wasn't there. It seems to actually be calling Illuminate\Routing\Router
. I haven't dug into how it is calling this on the Router
class yet.
But when I looked at the Router
class's get
function it's not static. Following a stack trace it seems that it is going through some Facade
classes that manage a singleton instance of the class, and then use __callStatic
to call the instance methods.
Is it possible to write my code without taking advantage of some of these shortcuts? My IDE is not able to follow these things very well so I lose autocomplete and function details. I tried to instantiate a Router
instance manually and call the get
function dynamically but it did not seem to get hooked into the application and was ignored. I would also like to explicitly include Laravel namespaces, but it seems to convert things like Route
to \Illuminate\Routing\Router
automatically, which I'm finding difficult to follow.