{"id":1740,"date":"2018-08-29T09:14:00","date_gmt":"2018-08-29T09:14:00","guid":{"rendered":"https:\/\/www.htmlgoodies.com\/uncategorized\/how-laravel-speeds-up-app-development\/"},"modified":"2021-04-23T20:08:41","modified_gmt":"2021-04-23T20:08:41","slug":"how-laravel-speeds-up-app-development","status":"publish","type":"post","link":"https:\/\/www.htmlgoodies.com\/mobile\/how-laravel-speeds-up-app-development\/","title":{"rendered":"How Laravel Speeds Up App Development"},"content":{"rendered":"
Laravel is an open-source PHP framework by Taylor Otwell for creating full-featured web applications. It features a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, and utilities that aid in application deployment and maintenance, that is oriented toward syntactic sugar. For those of you who are proficient in PHP, Laravel will make your job a lot easier by saving you time compared to developing a website from scratch. As an added bonus, websites built in Laravel are more secure and are resistant to several types of web attacks.<\/p>\n
In this tutorial, we will learn two ways to work with Laravel: first, on its own, then within the Laravel Homestead Virtual Machine environment.<\/p>\n
Laravel uses Composer<\/a> for managing dependencies so you’ll have to install it before you install Laravel. During the installation process, Composer will ask you to point it to your PHP executable.<\/p>\n Once Composer is installed, you can check the installation by typing <\/p>\n Now we’re ready to create our Laravel project. Create a new directory anywhere in your system for your new Laravel project. Then, cd into the parent of the new directory and type the following command there to install Laravel:<\/p>\n For example:<\/p>\n Composer will download a whole wack of modules and create the following directory structure:<\/p>\n <\/p>\n And that’s it! Now we can start the Laravel service by executing the following command:<\/p>\n Point your browser to http:\/\/localhost:8000\/ to see the default Laravel page:<\/p>\n <\/p>\n Laravel has a generally stricter set of server requirements than your typical PHP frameworks and projects. This allows Laravel to do more and make use of cool modern features. That’s why Laravel offers Homestead. It’s a pre-packaged Vagrant box that has all the necessary PHP configurations to use Laravel as well as some additional features. It’s also setup to so you can manage multiple sites and projects from a single virtual machine. Vagrant is a portable virtual software development environment. It’s written in the Ruby language and simplifies software configuration management of virtualizations in order to increase development productivity.<\/p>\n The process for installing Vagrant depends on your particular OS. I will cover Windows 10 here, but you can find instructions for other OSes on the Laravel Homestead site<\/a>.<\/p>\n Vagrant will then ask you which virtual box provider you want to use:<\/p>\n Now, the laravel\/homestead box will be downloaded and added to your Vagrant installation. It will take a few minutes to download the box, depending on your Internet connection speed. Git will keep you updated on its progress:<\/p>\n Eventually, like maybe thirty to forty minutes later, the installation will complete:<\/p>\n The next step is to clone the Official Laravel Repository onto your computer. You’re going to want to clone it to a location other than where all your projects reside. As you will find out, with Homestead you’re actually mapping all your projects to their folders on your computer. Homestead actually acts as a manager for your all your projects.<\/p>\n Create a new directory named “homestead” and then navigate to it within the console.<\/p>\n<\/li>\n Now we’ll clone the Homestead repository into the current (homestead) folder:<\/p>\ncomposer<\/code> at the command prompt. That should bring up the logo, version details, and a list of commands:<\/p>\n
composer create-project laravel\/laravel -- prefer-dist<\/code><\/pre>\n
C:\\Users\\blackjacques>mkdir laravel\n\nC:\\Users\\blackjacques>composer create-project laravel\/laravel -- prefer-dist<\/code><\/pre>\n
php artisan serve<\/code><\/pre>\n
Installing Laravel Homestead Components<\/h2>\n
\n
vagrant box add laravel\/homestead<\/pre>\n<\/li>\n
C:\\Users\\robg>vagrant box add laravel\/homestead\n==> box: Loading metadata for box 'laravel\/homestead'\n box: URL: https:\/\/vagrantcloud.com\/laravel\/homestead\nThis box can work with multiple providers! The providers that it\ncan work with are listed below. Please review the list and choose\nthe provider you will be working with.\n\n1) parallels\n2) virtualbox\n3) vmware_desktop\n\nEnter your choice: 2\n<\/pre>\n
==> box: Adding box 'laravel\/homestead' (v6.1.0) for provider: virtualbox\n box: Downloading: https:\/\/vagrantcloud.com\/laravel\/boxes\/homestead\/versions\/6.1.0\/providers\/virtualbox.box\n box: Progress: 40% (Rate: 552k\/s, Estimated time remaining: 0:28:27)\n<\/pre>\n
==> box: Adding box 'laravel\/homestead' (v6.1.0) for provider: virtualbox\n box: Downloading: https:\/\/vagrantcloud.com\/laravel\/boxes\/homestead\/versions\/6.1.0\/providers\/virtualbox.box\n box: Progress: 100% (Rate: 479k\/s, Estimated time remaining: -- : -- : -- )\n==> box: Successfully added box 'laravel\/homestead' (v6.1.0) for 'virtualbox'!\n<\/pre>\n<\/li>\n
C:\\Users\\blackjacques\\homestead>git clone https:\/\/github.com\/laravel\/homestead.git .\nCloning into '.'...\nremote: Counting objects: 2972, done.\nremote: Compressing objects: 100% (12\/12), done.\nremote: Total 2972 (delta 9), reused 22 (delta 9), pack-reused 2948\nReceiving objects: 100% (2972\/2972), 610.46 KiB | 387.00 KiB\/s, done.\nResolving deltas: 100% (1762\/1762), done.\n<\/pre>\n<\/li>\n