How To Set Up Laravel Apps On Windows

Chris DarešŸ”„
2 min readApr 10, 2017

--

This article is intended for course mates of my Internet-enabled Applications class. Feel free to skip- unless you also want to set up a Laravel application on Windows.

Hello class, good morning. Hereā€™s a quick and very basic tutorial on how to set up the Laravel apps on your PC. This is a very solid buildup on what weā€™ve already been developing in class.

ā€œLaravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine. Download Composer here: https://getcomposer.org/Composer-Setup.exe.ā€

After you finish downloading and installing Composer, you will automatically be able to access it in cmd with the command composer or composer.phar. Open the command window and enter either of these commands. One will work for you, the other will not:

composer global require "laravel/installer"orcomposer.phar global require "laravel/installer"

Thatā€™s it! You have successfully installed Laravel on your computer.

Once you are done, do this for each app.

Step 1: Download the project files (Obviously hehe). Hereā€™s the link for downloading: https://drive.google.com/open?id=0B_mIf9rNDJ9RendILUNVLTl5d0E

Step 2: Extract the zip file.

From here onwards I will refer to the extracted folder as the project folder.

In the project folder, rename the parameters of the database to suit your configuration. Youā€™ll need to do the following:

Step 4: open to the .env file and edit the database username and password properties to what you have already set for your MySQL configuration on your computer.

Step 5: Change the name of the database to a name of your choice and then create a database with that name on your pc with PHPMyAdmin or any equivalent software of your choice.

Step 6: Right inside your project folder, hold shift on your keyboard and right-click.Then choose the option to ā€œopen command window hereā€. This will open an instance of cmd.

Step 7: Run the command composer update.
If you see the error ā€œComposer could not find a composer.jsonā€ it means that you are not in the project file so go back to step 6.

Step 8: After that run the command php artisan migrate. This will set up your database tables and fields for the application.

Step 9: Now run the command php artisan serve. You will see a message telling you that the application is running on server. Copy the server address and paste it in your browser. By default, the server address is localhost:8000
If youā€™re canā€™t start the server then it means that another application on your computer is using that port and so you can run this case-sensitive command instead: php -S localhost:8090 -t public

Step 10: Smile at your success :)

Will catch up with you guys later.

--

--