This blog post is all about a tutorial on how to create a website using the laravel framework in a very easy to understand and step-by-step method. By the way, the main reason why I created this article is to help those struggling guys out there who's just starting their journey as a web developer or maybe doing this job for other reasons. I also encourage everyone to ask questions in every topic that I will be discussing through the comment form below. The only requirement I need for you to easily follow these steps without any delay is to have a first-hand knowledge on how to install a software in your computer.
Before anything else I would like to introduce myself to you. I'm an interactive and experienced web developer for more than 10 years now. Most of my projects are built using Laravel Framework due to its simplicity and elegance. You can look at some of my works at Australian Regional Network and this website itself.
In this tutorial we will make a full-stack multi-user blog website with both back-end and front-end functionality, capable of adding, editing, and deleting users and blog posts on the admin area.
This tutorial is divided into several different parts and sub-parts:
1. Localhost server downloading and installation
2. Composer package manager downloading and installation
3. Laravel framework downloading, installation, and setup
1. Front-end pages creation
2. Back-end pages creation
1. Deploying on a live server
So much for the introduction. Let's get started.
There are lots of choices out there when choosing what localhost server you want to use. These are XAMPP, WAMP, VertrigoServ, etc. But for the purpose of this tutorial I choose the WAMP server. Download WAMP now and install it on your computer. And by the way, I'm using windows 7 64 bit operating system in this tutorial. You may have equivalent process of installation depending on your OS. If something goes wrong in your installation it's maybe you've downloaded the wrong WAMP installer for your machine. Choose between 32 or 64 bit installer if you're using windows, mac version installer for mac, or linux version for linux operation system, etc. This WAMP package already include the PHP programming language installer, Apache server, and MySQL database. Once you've installed it successfully it's time to check if it's running smoothly. You can see a green WAMP icon at your icon tray on your system when it's good to go. If it's red then it's not working fine and if it's yellow-orange then there's a conflict in the MySQL port (it means MySQL is using a port that's already been used). See the image below:
Next, it's time to download and install the composer package. But before you can do this successfully you need to add the path of the php executable file into the environment variable of your system. Simply go to the directory where you've installed your wamp server and then find the bin folder and inside it is the php folder and then select the php version folder and go inside it. If this is your first time installing the php installer or the WAMP server then you can only see just one folder with version. In my case it's C:\wamp64\bin\php\php7.2.4. Copy the path and paste it in your environment variable. You can find your environment variable (in windows OS) by pressing the window key + R simultaneously and then paste this code rundll32.exe sysdm.cpl,EditEnvironmentVariables in the dialog box and then press enter. There you'll see the PATH under the variable column, click the PATH and then click the Edit button below. A new dialog will appear. Add a semi-colon at the end of all the paths and the paste the php path you've got from wamp installation directory. In my case it's C:\wamp64\bin\php\php7.2.4 and then press OK to exit the last dialog box and then press OK again to make changes in the environment variables. See the image below:
Then press OK.
Then press Edit.
Then add a semi-colon at the end of all paths and paste the php path from WAMP installation directory and click OK.
After you've done all these step then you're good to go to install composer without any errors.