Where we take good care of both your front and back-end needs
Great place to take your code to the next level
Checkout my work and get in touch
Written by Rastko
date - 22/Aug/18 | views - 461
Laravel starter application will help all, who are new to this PHP framework, get a clear understanding of how to initialize a new project, setup a local configuration for easy development and run a few artisan and npm scripts to get you started.
This is the first in a series of posts, describing the full development of a Laravel app.
That was a lot, but getting in prepared will save you time in the long run.
Ok, now that you have all the tools for the job, it's time to start your first Laravel application.
In the terminal of your choice navigate to the htdocs folder within the XAMPP installation. It will look something like:
Now, initialize the app with the following command:
composer create-project laravel/laravel yourappname
Note - it will take some time so don't worry about it.
This part is optional, but highly recommended. It will basically allow you to simulate a real host and not serve your application from a public folder, which can be a security risk.
Here, we have to edit two files:
First file is httpd-vhost.conf, located in C:\xampp\apache\conf\extra
Scroll to the bottom and add the following:
<VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/yourappname/public" ServerName yourappname.me </VirtualHost>
There are other possible parameters available, but for our example these will suffice.
The first line declares the location of a public folder in your application, and the second the name of the virtual server. The server name does not need to end with .me, and in other examples you might find .dev. The reson I included .me is because some people had problems using the .dev.
Now to edit the second file, you need to follow these instructions exactly.
First, open your Notepad as Administrator (right click - Run as administrator)
Got to File - Open and browse to:
Make sure you have All Files selected instead of Text files, as the hosts file will be invisible. At the bottom of this file add:
127.0.0.1 localhost 127.0.0.1 sampleapp.me
If you already have the localhost, then only the second line is necessary. This process is needed to configure the system host. Save the file and restart Apache.
Now you can open your browser and type:
You'll be greeted by a welcome page
The starter app is done!
In the next chapter, we'll take a look at the folder structure of a simple Laravel app and also enable styling though Node and Sass.
Currently working on a Laravel projectCheck it out