artisan (2)


Artisan, our best friend

Well, to start, artisan is based on Console component of Symfony. Let’s see what the documentation says about the Artisan.

Artisan is the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application.

In this post we will focuses on most used commands from artisan. Artisan is nothing more than a php script that runs in console and can assist us in some boring and repetitive tasks.

If you use the list commands, you will see the complete list of available commands in artisan.

Like documentation says:

Every command also includes a “help” screen which displays and describes the command’s available arguments and options. To view a help screen, simply precede the name of the command with help:

Important notes

  • I advise you to see all commands with help to understanding more about the artisan;
  • You can create your own commands;
  • Commands are grouped by context;



MVC in Laravel – Part 2

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.