HOWTOlabs  
 Services     Software     Commentary     Design     Astral Musings   
Laravel
Popular PHP framework

Laravel 5
rickatech 2016-10

Related [edit]

Elsewhere

Laravel is a web application development framework that leverages the PHP service-side programming language.  Around 2015 the wide use of PHP package management tool composer and a maturating of the Laravel framework combine to make it relatively easy for a non-sysadmin developer to obtain and configure Laravel framework files for custom web application development.

Laravel as of 2016 requires at least PHP 5.6 which may require some sysadmin custom configuration for certain operating systems.

# rpm -qa | grep mbstr

  php-mbstring-5.6.27-1.el7.remi.x86_64

# rpm -qa | grep -i phpunit

  ...
  php-phpunit-PHPUnit-5.6.1-1.el7.remi.noarch
  ...

# wget https://getcomposer.org/installer

# php installer 

  All settings correct for using Composer
  Downloading 1.2.1...

  Composer successfully installed to: /root/installers/composer/composer.phar
  Use it: php composer.phar

# mv composer.phar /usr/local/bin/composer 

  [ normal user ]  

Laravel typically is installed and configured by non-sysadmin user commands.

$ composer global require "laravel/installer"

$ find ~ -name "comp*"

  ./.config/composer
  ./.cache/composer
  ./.local/share/composer

$ ~/.config/composer/vendor/bin/laravel new lv_test

$ cat /etc/group | grep webapp

  webapp:x:101:rickatech,apache

$ ls -lh

  user1 webapp   lv_test
  user1 user1    site -> laravel/public
  user1 webapp   test

  [ make sure apache has write privileges
    lv_test/public can be attached to a vhost ]    

Additional Commands

$ composer create-project laravel/laravel test_laravel --prefer-dist

$ composer install

  [ typically this is performed after a fresh git checkout
    to flesh out all the 3rd party files that should be project independent ]

$ composer upgrade  

  [ update core Laravel files to latest version,
    this can be quite disruptive to long running project version control ]

$ php artisan route:list

  +----------+----------+-------------------------------------------------+--------------+
  | Method   | URI      | Action                                          | Middleware   |
  +----------+----------+-------------------------------------------------+--------------+
  | GET|HEAD | /        | Closure                                         | web          |
  | GET|HEAD | api/user | Closure                                         | api,auth:api |
    ...        ...        ...                                               ...
  | POST     | register | App\...\RegisterController@register             | web,guest    |
  | GET|HEAD | register | App\...\RegisterController@showRegistrationForm | web,guest    |
  | GET|HEAD | submit   | Closure                                         | web          |
  | POST     | submit   | Closure                                         | web          |
  +----------+----------+-------------------------------------------------+--------------+ 
zap technologies
tablet | printable