Creating a new laravel site

Creating a new laravel site

Having installed Laravel you’ll now want to create your first Laravel website.

Creating the new Laravel site

In the command line navigate to the parent directory which contains all your web projects. On my Ubuntu system my projects are all in /var/www/html, so on the command line:

cd /var/www/html

Decide on a name for your project. We’ll call ours my-cool-website. Now run the new command from the command line like this:

laravel new my-cool-website

 

 

 

 

 

 

 

 

 

 

At this stage with a fresh Laravel installation and having just run the new command you can check the site using Laravel’s built in server by running artisan’s serve command:

php artisan serve

 

 

You should get the reply that the server has started along with a URL including a port number. Copy that and paste into a browser.

Error

At this stage you’ll probably encounter the error “No application encryption key has been specified.”. To fix this type the artisan command to set the encryption key:

php artisan key:generate

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *