Laravel 5.4 tutorial for beginners
Laravel is a poupular PHP framework ,first created in 2011 and always growing in popularity .In 2015 Laravel was the most starred PHP framework on Github .Since its first days ,it has experienced an exponential adoption among PHP developers .
Laravel has a lot of modern features just like the well known Python framework Django .It is also based on Symfony ,one of the greatest PHP framework and is considered by many developers as a lightweight version of Symfony .
In this tutorial ,we are going to focus on the latest version of Laravel which is 5.4 ,released on January 2017 .
Throughout this tutorial or tutorial series ,we are going to build a PHP web application for creating invoices .It is in the same time an application that I need right now and also can be used to demonstrate how many features and constructs of Laravel 5.4 framework work ,from templates and routes to models and database .
First things first .We are going to start by installing Laravel 5.4 on our system but we are not going to cover how to install PHP so this tutorial has some few requirements which are :
A PHP environment installation .
MySQL database system installed .
So you need to have PHP installed on your system ,to check it ,open your terminal on Linux/MAC or command prompt on Windows and type
You should get something like this
PHP 7.0.6-1+donate.sury.org~wily+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
Which means I have PHP 7 installed .
If the command is not recognizable by your system then go ahead and install PHP before continuing with this tutorial .
Now lets install Composer .In case you are wondering ,this is a package/dependency manager for PHP that allows you too pull and automatically install PHP packages (frameworks ,libraries etc.) from a remote registry where other PHP developers publish their packages for everybody to install .For example ,Laravel 5.4 itself can be installed using Composer .
To install Composer ,visit this website then copy the installer script and paste it in your terminal .The installer will download the latest composer.phar
to your current directory.
To run Composer ,type
From the same directory where you have downloaded the installer script .
You can also make Composer available globally by putting it in a folder that's part of the PATH system variable
On Unix based systems such as Linux and MAC you can do something like that
sudo mv composer.phar /usr/local/bin/composer
Or without sudo on some systems ,by the way I'm using an Ubuntu system so the commands I enter maybe different on your system .
Now you can run
To use Composer from your terminal .
Downloading and installing Laravel 5.4
Using Composer you can install larave 5.4 with just one command
composer global require "laravel/installer"
Next add $HOME/.config/composer/vendor/bin to your PATH system variable to make laravel available from any directory .
Now you can type laravel on your terminal to see a list of available commands at your disposal
Creating a new Laravel project
To create a new Laravel 5.4 project ,just type
laravel new MyApp
You can also use Composer to create a Laravel project without using the laravel utility
composer create-project --prefer-dist laravel/laravel MyApp
Now you can run your local server with
cd MyApp php artisan serve
You should be able to visit your web app at http://localhost:8000
You can find more instructions about installation on Laravel 5.4 docs
So we have created our fresh Laravel 5.4 project .See you on the next part where we are going to dive into creating database Models for our project .
- Django 2 Ajax CRUD with Python 3.7 and jQuery
- PHP 7 Tutorial with MySQL: CRUD REST API & JWT
- Django 2 CRUD Tutorial: Generic Class-Based Views
- Angular 6|7 Tutorial — CRUD & Python REST API
- Python 3.7 Matplotlib — Data Visualization Tutorial
- Python 3.7 Data Classes — Tutorial by Example
- Ember 3 Tutorial: Building your First Application
- Django Authentication — Login, Logout and Password Change/Reset
- Ubuntu 18.04: Install Python 3.7 | 3.6, pip and venv
- Vertical Center in Bootstrap 4
- Angular 6|7 ngIf by Example
- Angular 6|7 ngFor Example
- JWT Auth with Vue, Vuex and Vue Router — Axios & Guards
- Node Express JWT Authentication — jsonwebtoken and bcryptjs
- Python Django JWT — djangorestframework-jwt Example
- Adonis Tutorial — CRUD REST API and JWT Authentication
- Adonis Tutorial — JWT Authentication
- Installing PostgreSQL on Ubuntu 18.04
- PostgreSQL & PostGIS Tutorial — Creating a Spatial Database
- Installing GDAL 2+ on Windows 7 & Windows 10
- Swift Vapor Tutorial — Creating a REST API
- es6 template strings or literals
- Django Form Example—Bootstrap 4 UI via django-crispy-forms
- Django TemplateView GET|POST Example — URLs, as_view and get_context_data
- CSS Grid Layout Tutorial—Styling a Django Template
- Vuex Tutorial
- Redux Tutorial
- Angular 7|6 with PHP and MySQL Example & Tutorial
- Ethereum Dapps with Truffle,Ganache, Metamask, OppenZippelin and React
- Angular 7|6 In-Memory Web API Tutorial | CRUD Example
- Using Vue.js in WordPress
- Learn Sails.js Tutorial 
- Using Vue.js in PHP Tutorial
- Angular 7|6 Material Data-Table Tutorial & Example