Content area
Full Text
In no time at all, Kent Elchuk will guide you with precise instruction on building web apps with the highly adaptable and intuitive Laravel framework.
(ProQuest: ... denotes formulae omitted.)
Those of you with any experience in web development will likely have heard of frameworks, which are used to build web applications. With PHP, there are several options, such as Zend, Cake, Codeigniter, Yii and Symfony. And the most popular framework is Laravel. One example of an application built with such a PHP framework is the e-commerce shopping cart script called Magento, that's used by companies such as Canon, Graze and Burger King.
All frameworks are similar in concept. They use MVC, which stands for model, view and controller. This enables developers to build web applications relatively quickly, because logic and view are separated out and can be worked on by various team members. Alternatively, it keeps things organised for a single user.
Without further ado, let's take an introductory tutorial into the world of Laravel. Because the framework uses PHP, you need to have it installed and running with a usable web server such as Apache or Nginx.
Database details
Once Laravel is installed, you can get down and dirty with a database-driven web app. Step one is to set up an empty database using phpMyAdmin or the mySQL console. The command with mySQL is CREATE database mylaravel. With phpMyAdmin, you can create a database with a GUI. Two good collations are utf8_unicode_ci and utf8mb4_ci.
Because Laravel is typically used for database applications, let's point you to the two files that make Laravel access a database. To begin, go into the root folder for the Laravel application and open the .env file. Now you can provide a database, username and password. Make sure your username and password are accurate or it won't work:
DB_DATABASE=mylaravel
DB_USERNAME=kent
DB_PASSWORD=kent
While you're at it, you can open config/database.php and use the same database settings for mySQL there, too.
Authentication process
Although we don't want to get too far ahead of ourselves, it's good to have a glimpse at how Laravel can work with a database and add pieces to an application. In our case, we're going to add authentication to our web app. Let's run a couple...