0

new to Laravel (coming from Java spring), while using

Route::get('/', function()
{
    return "Hello World!";
});

Above, we dont need to include any header files(in this and all other configuration files for LaraveL), why is this so!, as Route is in a different name-space

http://laravel.com/api/class-Laravel.Routing.Route.html

1 Answer 1

3

Laravel uses the PHP class_alias function[1] to make some core classes available without their namespace. There is a list of these classes used to configure the Laravel\Autoloader class in application/config/application.php in the 'aliases' option[2].

  1. http://php.net/class_alias
  2. https://github.com/laravel/laravel/blob/master/application/config/application.php#L141-183
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.