Laravel offers us a great diversity possibilities out of box. Like as environments of production and development, and knowing about config is essential to start understanding how framework works.
It is often helpful to have different configuration values based on the environment where the application is running. For example, you may wish to use a different cache driver locally than you do on your production server.
By default the main configuration file is .env and it’s in main folder. How I told in a past post, Laravel uses the DotEnv Library to get these variables inside this file. The .env file is ignored by GIT because each environment can have a different configuration.
Still talking about routes
Behind every request has a pre-defined route for it action.
Laravel uses the HTTP Verbs in your routes, however by default HTML forms do not support PUT, PATCH or DELETE actions. To get around you will need to add a hidden _method field to the form.
Let’s see the default actions of a resource controller
Back to our default example
We will create a simple page with news from database to demonstrate how it works. In future we will see more about each topic of this first example, remember it’s only to demonstrates how is MVC in Laravel. Don’t focuses on little details because we will review each topic with more details.
Artisan the power of console
Some tasks in development are repetitive and boring, it’s cool have I friend in these times, yes we have, it’s artisan, the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application.
Type php artisan in your application root directory to see a lot of commands that you can do with it.