Create project directory
$ mkdir $APPDIR && cd $APPDIR
Clone Illuminate App
$ git clone https://github.com/illuminate/app.git
Install everything via Composer
$ composer install
Write permissions for /app/storage
directory
$ sudo chmod -R 777 app/storage
Make a new controller
$ php artisan controller:make SampleController
Add resource in routes.php
Route::resource('sample', 'SampleController');
Dump autoload
$ composer dumpautoload
Database connection (if MAMP is used)
<?php
return array(
'connections' => array(
'mysql' => array(
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
)
)
);
Enable migrations
$ php artisan migrate:install
Create sample migration
$ php artisan migrate:make create_comments_table --create="comments"
<?php
public function up()
{
Schema::create('comments', function($table)
{
$table->increments('id');
$table->string('title');
$table->text('body');
$table->integer('author');
});
}
public function down()
{
Schema::drop('comments');
}
$ php artisan migrate
Seeding the table
<?php
// app/database/seeds/comments.php
return [
[
'title' => 'hello there',
'body' => 'I wish you a warm welcome',
'author' => '5'
],
[
'title' => 'Another hello',
'body' => 'I want to greet you another time',
'author' => '1'
]
];