├── public ├── favicon.ico ├── packages │ └── .gitkeep ├── robots.txt ├── .htaccess └── index.php ├── app ├── commands │ └── .gitkeep ├── config │ ├── packages │ │ └── .gitkeep │ ├── compile.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── workbench.php │ ├── view.php │ ├── remote.php │ ├── queue.php │ ├── auth.php │ ├── cache.php │ ├── database.php │ ├── mail.php │ ├── session.php │ └── app.php ├── controllers │ ├── .gitkeep │ ├── HelloController.php │ ├── BaseController.php │ ├── UsersController.php │ ├── HomeController.php │ ├── PostsController.php │ └── BookController.php ├── database │ ├── seeds │ │ ├── .gitkeep │ │ ├── DatabaseSeeder.php │ │ ├── TagTableSeeder.php │ │ ├── AuthorTableSeeder.php │ │ └── BookTableSeeder.php │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2014_03_20_205153_create_tags_table.php │ │ ├── 2014_03_20_205201_create_book_tag_table.php │ │ ├── 2014_03_20_205144_create_authors_table.php │ │ ├── 2014_03_20_212607_create_books_table.php │ │ └── 2014_03_20_203143_create_posts_table.php │ └── production.sqlite ├── start │ ├── local.php │ ├── artisan.php │ └── global.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── views │ ├── header.blade.php │ ├── hello.blade.php │ ├── test.blade.php │ ├── emails │ │ └── auth │ │ │ └── reminder.blade.php │ ├── books │ │ ├── index.blade.php │ │ ├── show.blade.php │ │ ├── create.blade.php │ │ └── edit.blade.php │ └── layouts │ │ └── master.blade.php ├── models │ ├── Tag.php │ ├── Author.php │ ├── Book.php │ ├── Post.php │ └── User.php ├── tests │ ├── ExampleTest.php │ └── TestCase.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── routes.php └── filters.php ├── .gitattributes ├── .env.php ├── .gitignore ├── CONTRIBUTING.md ├── server.php ├── phpunit.xml ├── readme.md ├── composer.json ├── bootstrap ├── paths.php ├── start.php └── autoload.php └── artisan /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/start/local.php: -------------------------------------------------------------------------------- 1 | 2 | This is the Header 3 | -------------------------------------------------------------------------------- /app/views/hello.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello, {{{ $name }}}!

4 | 5 | -------------------------------------------------------------------------------- /.env.php: -------------------------------------------------------------------------------- 1 | 'db_user', 5 | 'MYSQL_PASS' => 's3creT_pa5sw0rD', 6 | ); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | composer.lock 5 | .env.local.php 6 | .DS_Store 7 | Thumbs.db -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository! -------------------------------------------------------------------------------- /app/models/Tag.php: -------------------------------------------------------------------------------- 1 | belongsToMany('Book'); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /app/views/test.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.master') 2 | 3 | @section('sidebar') 4 | @parent 5 |

This is appended to the master sidebar.

6 | @stop 7 | 8 | @section('content') 9 |

This is my body content.

10 | @stop -------------------------------------------------------------------------------- /app/controllers/HelloController.php: -------------------------------------------------------------------------------- 1 | hasMany('Book'); 10 | } 11 | 12 | public function getNameAttribute() 13 | { 14 | return $this->first_name . ' ' . $this->last_name; 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/views/emails/auth/reminder.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}. 11 |
12 | 13 | -------------------------------------------------------------------------------- /app/views/books/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.master') 2 | 3 | @section('title') 4 | All Books 5 | @stop 6 | 7 | @section('content') 8 | 16 | @stop 17 | -------------------------------------------------------------------------------- /app/tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('AuthorTableSeeder'); 15 | $this->call('BookTableSeeder'); 16 | $this->call('TagTableSeeder'); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/controllers/UsersController.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | EOB; 12 | } 13 | 14 | public function postProfile() { 15 | return 'This is the POST profile route.'; 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | belongsTo('Author'); 10 | } 11 | 12 | public function tags() 13 | { 14 | return $this->belongsToMany('Tag'); 15 | } 16 | 17 | 18 | public function getTaglistAttribute() 19 | { 20 | $tags = $this->tags->lists('name'); 21 | 22 | return join(', ', $tags); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | title }}} 5 | @stop 6 | 7 | @section('content') 8 | 9 |

by {{ $book->author->name }}

10 | 11 |

12 | {{{ $book->description }}} 13 |

14 | 15 |

Tags

16 |

17 | {{{ $book->taglist ?: 'none' }}} 18 |

19 | 20 | 21 | {{ link_to_route('books.edit', 'Edit', $book->id) }}
22 | 23 | {{ Form::open( array('route'=> array('books.destroy', $book->id), 'method'=>'delete') ) }} 24 | {{ Form::submit('Delete') }} 25 | {{ Form::close() }} 26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); -------------------------------------------------------------------------------- /app/database/migrations/2014_03_20_205153_create_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('tags'); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('book_id')->unsigned()->index(); 18 | $table->integer('tag_id')->unsigned()->index(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('book_tag'); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/database/seeds/TagTableSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 8 | DB::table('book_tag')->delete(); 9 | 10 | $tag = Tag::create(array( 11 | 'name' => 'fiction', 12 | )); 13 | $tag->books()->sync(array(1,2,3,4,5,6,7,8,9)); 14 | 15 | $tag = Tag::create(array( 16 | 'name' => 'science-fiction', 17 | )); 18 | $tag->books()->sync(array(6,7,8,9)); 19 | 20 | $tag = Tag::create(array( 21 | 'name' => 'fantasy', 22 | )); 23 | $tag->books()->sync(array(4,5,7)); 24 | 25 | $tag = Tag::create(array( 26 | 'name' => 'mystery', 27 | )); 28 | $tag->books()->sync(array(5,7,8)); 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /app/database/migrations/2014_03_20_205144_create_authors_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('first_name'); 18 | $table->string('last_name'); 19 | $table->string('email')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('authors'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/database/migrations/2014_03_20_212607_create_books_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('title', 50); 18 | $table->string('description')->nullable(); 19 | $table->integer('author_id')->unsigned()->index(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Scheme::drop('books'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/views/books/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.master') 2 | 3 | @section('title') 4 | Create a Book 5 | @stop 6 | 7 | @section('content') 8 | 9 | {{ Form::open(array('route'=>'books.store')) }} 10 | 11 |
    12 | 13 |
  1. 14 | {{ Form::label('title') }} 15 | {{ Form::text('title')}} 16 |
  2. 17 | 18 |
  3. 19 | {{ Form::label('author_id', 'Author') }} 20 | {{ Form::select('author_id', $authors) }} 21 |
  4. 22 | 23 |
  5. 24 | {{ Form::label('description') }} 25 | {{ Form::textarea('description')}} 26 |
  6. 27 | 28 |
29 | 30 | @if( $errors->any() ) 31 | 36 | @endif 37 | 38 | {{ Form::submit() }} 39 | 40 | {{ Form::close() }} 41 | 42 | @stop 43 | -------------------------------------------------------------------------------- /app/models/Post.php: -------------------------------------------------------------------------------- 1 | attributes['text'] = $value; 26 | 27 | // not limited to modifying the one attribute 28 | $this->attributes['excerpt'] = substr($value,0,97) . '...'; 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /app/database/migrations/2014_03_20_203143_create_posts_table.php: -------------------------------------------------------------------------------- 1 | ./arti increments('id'); 17 | $table->string('title', 50); 18 | $table->text('text')->nullable(); 19 | $table->string('excerpt',100)->nullable(); 20 | $table->boolean('active')->default(true); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('posts'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/views/books/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.master') 2 | 3 | @section('title') 4 | Edit a Book 5 | @stop 6 | 7 | @section('content') 8 | 9 | {{ Form::model($book, array('route' => array('books.update', $book->id), 'method'=>'PUT') ) }} 10 | 11 |
    12 | 13 |
  1. 14 | {{ Form::label('title') }} 15 | {{ Form::text('title')}} 16 |
  2. 17 | 18 |
  3. 19 | {{ Form::label('author_id', 'Author') }} 20 | {{ Form::select('author_id', $authors) }} 21 |
  4. 22 | 23 |
  5. 24 | {{ Form::label('description') }} 25 | {{ Form::textarea('description')}} 26 |
  6. 27 | 28 |
29 | 30 | @if( $errors->any() ) 31 | 36 | @endif 37 | 38 | {{ Form::submit() }} 39 | 40 | {{ Form::close() }} 41 | 42 | @stop 43 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.1.*" 8 | }, 9 | "autoload": { 10 | "classmap": [ 11 | "app/commands", 12 | "app/controllers", 13 | "app/models", 14 | "app/database/migrations", 15 | "app/database/seeds", 16 | "app/tests/TestCase.php" 17 | ] 18 | }, 19 | "scripts": { 20 | "post-install-cmd": [ 21 | "php artisan clear-compiled", 22 | "php artisan optimize" 23 | ], 24 | "post-update-cmd": [ 25 | "php artisan clear-compiled", 26 | "php artisan optimize" 27 | ], 28 | "post-create-project-cmd": [ 29 | "php artisan key:generate" 30 | ] 31 | }, 32 | "config": { 33 | "preferred-install": "dist" 34 | }, 35 | "minimum-stability": "stable" 36 | } 37 | -------------------------------------------------------------------------------- /app/database/seeds/AuthorTableSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 8 | 9 | Author::create(array( 10 | 'id' => 1, 11 | 'first_name' => 'Herman', 12 | 'last_name' => 'Melville', 13 | 'email' => 'herman@pequod.net' 14 | )); 15 | 16 | Author::create(array( 17 | 'id' => 2, 18 | 'first_name' => 'William', 19 | 'last_name' => 'Shakespeare', 20 | 'email' => 'bard@theglobe.co.uk' 21 | )); 22 | 23 | Author::create(array( 24 | 'id' => 3, 25 | 'first_name' => 'Isaac', 26 | 'last_name' => 'Asimov', 27 | 'email' => 'outer@space.ca' 28 | )); 29 | 30 | Author::create(array( 31 | 'id' => 4, 32 | 'first_name' => 'Phillip', 33 | 'last_name' => 'Dick', 34 | 'email' => 'bladerunner@replicant.tv' 35 | )); 36 | 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/views/layouts/master.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @yield('title', 'Default title') 5 | 6 | 16 | 17 | 18 | @if( $alert = Session::get('alert', null) ) 19 |
20 | {{ $alert }} 21 |
22 | @endif 23 | 24 |

25 | @yield('title', 'Default title') 26 |

27 | 28 |
29 | @yield('content', 'Default content') 30 |
31 | 32 |
33 | @foreach( DB::getQueryLog() as $query )
34 | {{{ $query['query'] }}}
35 | @endforeach
36 | 
37 | 38 | 39 | -------------------------------------------------------------------------------- /app/models/User.php: -------------------------------------------------------------------------------- 1 | getKey(); 30 | } 31 | 32 | /** 33 | * Get the password for the user. 34 | * 35 | * @return string 36 | */ 37 | public function getAuthPassword() 38 | { 39 | return $this->password; 40 | } 41 | 42 | /** 43 | * Get the e-mail address where password reminders are sent. 44 | * 45 | * @return string 46 | */ 47 | public function getReminderEmail() 48 | { 49 | return $this->email; 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/controllers/PostsController.php: -------------------------------------------------------------------------------- 1 | 'my first post', 40 | 'text' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 41 | 'active' => true, 42 | ) 43 | ); 44 | 45 | return <<< EOB 46 |

$post->title

47 |

$post->excerpt

48 |

$post->text

49 | EOB; 50 | }); 51 | 52 | 53 | Route::resource('books', 'BookController'); -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); -------------------------------------------------------------------------------- /bootstrap/paths.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | ), 42 | 43 | 'sqs' => array( 44 | 'driver' => 'sqs', 45 | 'key' => 'your-public-key', 46 | 'secret' => 'your-secret-key', 47 | 'queue' => 'your-queue-url', 48 | 'region' => 'us-east-1', 49 | ), 50 | 51 | 'iron' => array( 52 | 'driver' => 'iron', 53 | 'project' => 'your-project-id', 54 | 'token' => 'your-token', 55 | 'queue' => 'your-queue-name', 56 | ), 57 | 58 | 'redis' => array( 59 | 'driver' => 'redis', 60 | 'queue' => 'default', 61 | ), 62 | 63 | ), 64 | 65 | /* 66 | |-------------------------------------------------------------------------- 67 | | Failed Queue Jobs 68 | |-------------------------------------------------------------------------- 69 | | 70 | | These options configure the behavior of failed queue job logging so you 71 | | can control which database and table are used to store the jobs that 72 | | have failed. You may change them to any database / table you wish. 73 | | 74 | */ 75 | 76 | 'failed' => array( 77 | 78 | 'database' => 'mysql', 'table' => 'failed_jobs', 79 | 80 | ), 81 | 82 | ); 83 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'emails.auth.reminder', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); 72 | -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | delete(); 8 | 9 | Book::create(array( 10 | 'id' => 1, 11 | 'title' => 'Moby Dick', 12 | 'author_id' => 1, 13 | 'description' => 'An epic sea story of Captain Ahab\'s voyage in pursuit of Moby Dick, a great white whale.' 14 | )); 15 | Book::create(array( 16 | 'id' => 2, 17 | 'title' => 'The Confidence-Man', 18 | 'author_id' => 1, 19 | 'description' => 'The interlocking stories of a group of steamboat passengers, as they travel down the Mississippi River toward New Orleans.' 20 | )); 21 | 22 | Book::create(array( 23 | 'id' => 3, 24 | 'title' => 'Hamlet', 25 | 'author_id' => 2, 26 | 'description' => 'A Danish prince\'s indecion causes trouble for everyone, including his girlfriend who should have taken swimming lessons.' 27 | )); 28 | Book::create(array( 29 | 'id' => 4, 30 | 'title' => 'A Midsummer Night\'s Dream', 31 | 'author_id' => 2, 32 | 'description' => 'A group of travelling actors meet two love-struck couples, and one of them makes an ass of themselves.' 33 | )); 34 | Book::create(array( 35 | 'id' => 5, 36 | 'title' => 'Macbeth', 37 | 'author_id' => 2, 38 | 'description' => 'Driven to becoming King, Macbeth will kill all and any that get in his way. Also, witches.' 39 | )); 40 | 41 | Book::create(array( 42 | 'id' => 6, 43 | 'title' => 'I, Robot', 44 | 'author_id' => 3, 45 | 'description' => 'Short stories about the interaction of humans, robots, and morality' 46 | )); 47 | 48 | Book::create(array( 49 | 'id' => 7, 50 | 'title' => 'Do Androids Dream of Electric Sheep?', 51 | 'author_id' => 4, 52 | 'description' => 'A bounty hunter polices the local android population.' 53 | )); 54 | Book::create(array( 55 | 'id' => 8, 56 | 'title' => 'A Scanner Darkly', 57 | 'author_id' => 4, 58 | 'description' => 'An undercover police detective begins to lose touch with reality after falling victim to a mind-altering drug.' 59 | )); 60 | Book::create(array( 61 | 'id' => 9, 62 | 'title' => 'The Minority Report', 63 | 'author_id' => 4, 64 | 'description' => 'The story of a society where murders are prevented through the efforts of three mutants who can see the future.' 65 | )); 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('your-machine-name'), 30 | 31 | )); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Bind Paths 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here we are binding the paths configured in paths.php to the app. You 39 | | should not be changing these here. If you need to change these you 40 | | may do so within the paths.php file and they will be bound here. 41 | | 42 | */ 43 | 44 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Load The Application 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here we will load this Illuminate application. We will keep this in a 52 | | separate location so we can isolate the creation of an application 53 | | from the actual running of the application with a given request. 54 | | 55 | */ 56 | 57 | $framework = $app['path.base'].'/vendor/laravel/framework/src'; 58 | 59 | require $framework.'/Illuminate/Foundation/start.php'; 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Return The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | This script returns the application instance. The instance is given to 67 | | the calling script so we can separate the building of the instances 68 | | from the actual running of the application and sending responses. 69 | | 70 | */ 71 | 72 | return $app; 73 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setRequestForConsoleEnvironment(); 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/controllers/BookController.php: -------------------------------------------------------------------------------- 1 | orderBy('title') 16 | ->get(); 17 | }); 18 | 19 | return View::make('books.index', compact('books')); 20 | } 21 | 22 | /** 23 | * Show the form for creating a new resource. 24 | * 25 | * @return Response 26 | */ 27 | public function create() 28 | { 29 | 30 | // the lists() method on the collection will create an array suitable for 31 | // use in