User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

laravel:start

This is an old revision of the document!


Laravel Notes

5/30/2016 Deciding to move to Laravel, partially at Michanel Hanes recommendation, also because I read that CakePhp is now old and not being supported much.

Installed Laravel 5.2.34

5/30/2016 Setting up workstation. Installed Composer to workstation, by opening XAMPP console, and running these lines:

(Check this location because the installation lines below will change: https://getcomposer.org/download/)

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '070854512ef404f16bac87071a6db9fd9721da1684cd4589b1196c3faf71b9a2682e2311b36a5079825e155ac7ce150d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

This worked. I can run composer with this:

php composer.phar

Now I can install laravel:

php composer.phar global require "laravel/installer"

It installed into c:\Users\dan\AppData\Roaming\Composer\Vender\bin

laravel new cantata3

BAD: It created a partially complete (missing vendor directory) project cantata3 under c:\Users\dan\AppData\Roaming\Composer\Vender\bin. Noticed when it ran it complained about missing the command “composer”. So I reran again with this command instead:

Using the XAMPP shell tool, ran this:

php composer.phar create-project --prefer-dist laravel/laravel cantata3

Which appears to have obtained laraval again, and also created a better version of cantata3.

Moving to WorkspacePHP

In EclipsePHP, created new PHP project “cantata3”, then copied generated content from the laravel step into the Eclipse canata3 directory.

Running Artisan

Noticed that there is an “artisan” file at the root of the project created by the steps above. The Laravel docs show commands like php artisan list but these need to be run from the root of the project.

In the Shell of XAMPP, do this to verify artisan commands:

cd c:\Users\dan\workspacePHP\cantata3
php artisan list

To create the Users table, ran this:

php artisan migrate:refresh

This ran the class under database/migrations

Making Models/Database Tables

php artisan make:model FileMeta -m

You create the migration file, edit it, and run with

php artisan migrate

This will create a PHP class in the Models directory.

YouTube Tutorial

Listened to “Website Builder” Laravel 5 tutorial. He made it very clear, and seems to be using Laravel 5.2 Also listened to others regarding Laravel 5.0, but it appears that the “best practices” may have changed>

https://www.youtube.com/watch?v=66LpDiStY5w

Max (the presenter) recommended http://c9.io as a development environment provider. From the notes above, I set it up on my PC. Assumedly it works OK for either. 6/16/2016

VirtualBox-Vagrant Installation

Following the instructions here: https://laravel.com/docs/5.2/homestead#installation-and-setup

  • Installed Oracle VM VirtualBox
  • Installaed Vagrant, but no clue it is installed
  • ran this from Windows CMD: vagrant box add laravel/homestead (8/12/2016 4:43 p.m.)
laravel/start.1471045501.txt.gz · Last modified: 2016/08/12 23:45 by dwheele