User Tools

Site Tools


laravel:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
laravel:start [2016/06/18 01:25]
dwheele
laravel:start [2016/12/22 01:22] (current)
dwheele
Line 4: Line 4:
  
   * https://laravel.com   * https://laravel.com
 +  * http://dancoivan/laravelcheatsheet/ (Local copy of Laravel 5.1 Cheat Sheet app)
 +  * [[eloquent|Eloquent Database Interaction Notes]]
 +
 +Installed Laravel **5.2.34**
  
 5/30/2016 Setting up workstation. Installed Composer to workstation, by opening XAMPP console, and running these lines: 5/30/2016 Setting up workstation. Installed Composer to workstation, by opening XAMPP console, and running these lines:
Line 54: Line 58:
    
 This ran the class under database/migrations 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 ===== ===== YouTube Tutorial =====
Line 62: Line 78:
  
 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 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 =====
 +
 +Why use VirtualBox-Vagrant? Explanation: https://www.sitepoint.com/re-introducing-vagrant-right-way-start-php/
 +
 +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.)
 +  * Installed git from https://git-scm.com/download
 +  * Ran from inside of a Git window
 +<code bash>
 +cd ~
 +git clone https://github.com/laravel/homestead.git Homestead
 +</code>
 +
 +then
 +<code bash>
 +cd ~/Homestead (probably actually cd \Users\dan\Homestead)
 +./init.sh
 +</code>
 +
 +There are two important areas, one is the ''\Users\dan\Homestead'' directory, the other is inside of the ''\Users\dan\.homestead'' directory (containing Homestead.yaml).
 +
 +The idea here is that there is a virtual machine with PHP, MySQL, and Laravel running. But we access it with virtual directories, not directly. There is also a way to virtually SSH to the running box.
 +
 +To start Vagrant:
 +
 +<code>
 +cd \Users\dan\Homestead
 +vagrant up
 +</code>
 +
 +The command ''vagrant ssh'' didn't work, so tried putty. There was a recommended key at this location:
 +
 +    Private key: C:/Users/dan/Homestead/.vagrant/machines/default/virtualbox/private_key
 +    
 +But it doesn't work with putty. Instead, logged in with vagrant:vagrant then changed password to a usual value.
 +
 +Helped get the folders setting correct:
 +
 +http://stackoverflow.com/questions/29143680/understanding-the-homestead-yaml-file-in-laravel
 +
 +8/29/2016
 +
 +==== Connecting to the Vagrant App with a Browser ====
 +
 +The file ''Homestead.yaml'' contains this part, which exposes "public" with a NGinx web server. I have to map "cantata3" to 192.168.10.10. 9/22/2016
 +
 +I added this to C:\Windows\System32\drivers\etc:
 +
 +<code>
 +192.168.10.10    cantata3
 +</code>
 +
 +I was able to ''ping cantata3'' and get a response. However, visiting ''cantata3/test.htm'' gave **No input file specified.** - not sure why 9/22/2016
 +
 +  * NGinx primer - https://blog.martinfjordvald.com/2010/07/nginx-primer/
 +  * How to solve No Input File Specified problem - https://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/
 +
 +Found these instructions (here: https://laravel.com/docs/5.3/homestead), which fixed the problem: 
 +
 +//If you change the sites property after provisioning the Homestead box, you should re-run //
 +<code>
 +vagrant reload --provision
 +</code>
 +//to update the Nginx configuration on the virtual machine.//
 +
  
  
laravel/start.1466213103.txt.gz · Last modified: 2016/06/18 01:25 by dwheele