6 Configuring Your Application
taylorotwell edited this page 2011-06-24 14:57:48 -07:00

The Basics

When starting a new project, you shouldn't be bombarded with loads of confusing configuration decisions. For that reason, Laravel is intelligently configured out of the box. The application/config/application.php file contains the basic configuration options for your application. Below you will find a description of the options commonly changed when starting a new project. Don't worry, there are only two.

URL

Laravel needs to know the URL you will use to access your application. Actually, this is the only configuration option that must be set when starting a new project! Simply set the url in the application/config/application.php file:

'url' => 'http://localhost';

Nice job! To help you follow the D.R.Y. (Don't Repeat Yourself) principle, Laravel provides a simple way to generate URLs for your application via the make method on the URL class. Be sure to check it out!

Note: If you are using mod_rewrite for cleaner URLs, you should set the index option to an empty string.

Timezone

All date-based operations performed by Laravel, such as writing log entires, will use the timezone specified in your application/config/application.php file. You may use any of the timezones supported by PHP:

'timezone' => 'UTC';