Installing Laravel
Laravel is a PHP framework so we need to start with a L(W)AMP server of some sort. We recommend PHP 7 but from PHP 5.6 will do.
Laravel is easiest to install with Composer.
Once Composer is installed according to their instructions, we can use it to install Laravel. There are different methods of installing Laravel but I prefer installing it as a global package on the system. To do this, on the command line type:
composer global require “laravel/installer”
and then press enter.
You’ll now need to add “$HOME/.composer/vendor/bin” to your system path so that your OS knows where to find Laravel. For Ubuntu we can do this in ~/.bashrc by adding the line:
export PATH=”$HOME/.composer/vendor/bin:$PATH”
This adds composer to your system path so that from the command line you can now type Laravel to see their help menus.
To create a fresh Laravel site all you need to do now is open a command line and cd to your web directory. So for me on Ubuntu:
cd /var/www/html
and then I run laravel like this:
laravel new my-cool-site
This will create the directory call my-cool-site with a new Laravel installation.
You should now use artisan to set the encryption key for the site you may get an error.
cd into your new directory:
cd my-cool-site
and type:
php artisan key:generate
You can now type:
php artisan serve
and copy the link it provides into a browser to see your new installation in action!
John, a seasoned Freelance Full Stack Developer based in South Africa, specialises in delivering bespoke solutions tailored to your needs. With expertise in PHP, Laravel, Vue3, and Nuxt3, I am equipped to tackle any project, ensuring robust, scalable, and cutting-edge outcomes.
My comprehensive skill set enables me to provide exceptional freelance services both remotely and in person. Whether you’re seeking to develop an innovative application or require meticulous refinement of existing systems, I am dedicated to elevating your digital presence through unparalleled technical prowess and strategic development methodologies. Let’s connect to transform your vision into reality.