mysterious
mysterious

Reputation: 1478

Where is Route::get() method defined in Laravel-4

I am first time using Laravel framework. Trying to read and understand code on my own. I am stuck on one place. Can't find where Route::get() method is defined. Can't find in following classes.

laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php
laravel/vendor/symfony/routing/Symfony/Component/Routing/Route.php

Curious in which file this method is defined and/or how they are using this method without even defining it. Hope this will help me understanding some advanced OOP feature.

Upvotes: 1

Views: 780

Answers (2)

Antonio Carlos Ribeiro
Antonio Carlos Ribeiro

Reputation: 87739

It is in

Illuminate/Routing/Router.php

In your app/config/app.php you should see this alias:

'Route'           => 'Illuminate\Support\Facades\Route',

This is the Route:: (alias class) to the Route facade:

Illuminate/Support/Facades/Route.php

where it finally points to the IoC binded 'router' instance:

$app['router']

created by the service provider at

Illuminate\Routing\RoutingServiceProvider.php

It's a long path :)

Upvotes: 2

user1669496
user1669496

Reputation: 33068

What's causing this are the Facades.

Facade Documentation might help you understand it better, but can be a fairly confusing topic.

Upvotes: 1

Related Questions