I am using laravel 4.2. I am following this basic tutorial on how to build Laravel Commands. I want to know where laravel is defining or registering the file paths to. For e.g.
use Illuminate\Console\Command;
is actually refering to the path below
vendor\laravel\framework\src\Illuminate\Console\Command.php
I am new to laravel, If you could point me to the right direction it would greatly help me.
So I studied how it locates the file it was using. Then I found out it is using a namespace
. The book called CODE BRIGHT by Dayle Rees greatly helped me in understanding how namespacing
works. You can scroll down under the section called THE PRIMERS
where Dayle describes how it functions. It is easy to understand! Give it a try.
there are two files you need to look at under app/config one is start.php this register the basic path for the laravel source files the base path . "/vendor/laravel/framework/src" .
the second one is app.php which provide an aliases array that correspond to the source classes and files.
for instance if you want to know where the class eloquent that your models are extending is at, you need to go to app.php see that Eloquent alias points toward 'Illuminate\Database\Eloquent\Model' and concat the path from start.php so it will be at \web\yourproject\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php
config.php holds the rest of the mapping.