Web Application

Short introduction to web application development

Laravel 5

The PHP Framework For Web Artisans

Laravel is a high-level PHP MVC framework. It is also the most used PHP framework today. For more information, click here.

This guide will help you setup your local development environment for Laravel, and it applies to setting up Lumen as well.

Dependencies for Laravel

Install Nginx Web Server

Laravel Valet and Laravel recommends using Nginx. Follow the nginx installation instructions here.

You can also choose Apache as the web server.

Install MariaDB Relational Database Server (Or other database you prefer)

Follow the MariaDB installation instructions here.

Setup environment for PHP development

Follow the PHP installation instructions here.

OR, you can rip the benefit of using Fedora, and install composer directly instead. This will install PHP, and all the required extensions/libraries needed.

# It will install all required extensions, perk of Fedora
$ sudo dnf install composer

Your web server needs to be restarted after installing PHP package.

Install Valet Linux

We will need to set it up for easier development. Valet is original designed for MacOS by the Laravel Team; Valet Linux is a port to that. It setups up the neccesary environments for PHP Development, including a test domain. Please do not run valet as root. For More Information, you can check them out here: Valet Linux and Laravel Valet

You can also setup Laravel using Vagrant, Docker.

# Place the ~/.config/composer/vendor/bin directory in your PATH so the composer 
# global executable can be located by your system.
$ echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
# Install valet 
$ composer global require cpriego/valet-linux
# Initialize valet
$ valet install

Setup Laravel

Install laravel installer

# Install Laravel Installer
$ composer global require "laravel/installer"
# use Laravel Installer to Create a new Laravel Project
$ laravel new ProjectName

Setup

$ cd ProjectName
$ cp .env.example .env
#Editing your environment file
$ gedit .env 

Edit the .env file with DB_* lines with the correct info

DB_HOST=localhost
DB_DATABASE=laravel_equals_winning
DB_USERNAME=Chur
DB_PASSWORD=Chur1

Serve

$ php artisan serve
# Laravel development server started on http://localhost:PORT/

# or use valet
$ valet park
$ valet link DOMAIN

# Now visit http://DOMAIN.test/
If ssl is desired
$ valet secure
# Now visit https://DOMAIN.test/

If need a callback URL/an URL over the internet
$ valet share

Authors: Jarek Prokop, Junhai, Nick Dirschel, Pavel Valena, Superdanby