On Github nickdenardis / learning-laravel-4
Created by Nick DeNardis / @nickdenardis
curl http://laravel.com/laravel.phar > laravel.phar sudo mv laravel.phar /usr/local/bin/laravel sudo chmod 777 /usr/local/bin/laravel
No longer need to use composer
cd ~/Sites/ laravel new projectname cd projectname
chmod -R 777 app/storage
// composer.json "require": { "laravel/framework": "4.1.*" }, "require-dev":{ "way/generators": "dev-master", "phpunit/phpunit": "3.7.*", "mockery/mockery": "0.7.*" },
curl https://gist.github.com/nickdenardis/8616001/raw/.editorconfig > .editorconfig
curl https://gist.github.com/nickdenardis/8615920/raw/Vagrantfile > Vagrantfile curl https://gist.github.com/nickdenardis/1a7c988e258d6d1affaf/raw/install.sh > install.sh
array( 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'project', 'username' => 'root', 'password' => 'local', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '' ) ) ); ?>
detectEnvironment(function(){ return getenv('ENV') ?: 'local'; }); ?>
Use the SSH Tunnel to connect to the database through Vagrant.
127.0.0.1 project.dev
vagrant up vagrant ssh http://project.dev/
curl https://phar.phpunit.de/phpunit.phar > phpunit.phar chmod +x phpunit.phar sudo mv phpunit.phar /usr/local/bin/phpunit
// composer.json "require": { "laravel/framework": "4.1.*", "doctrine/dbal": "~2.3" }, "require-dev":{ "way/generators": "dev-master", "phpunit/phpunit": "3.7.*", "mockery/mockery": "0.7.*", "itsgoingd/clockwork": "1.*" },
sudo subl /etc/paths vendor/bin
Create a /app/config/testing/database.php file.
array( 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'project', 'username' => 'root', 'password' => 'local', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '' ) ) ); ?>
vagrant ssh cd /vagrant phpunit