@@ -30,7 +30,7 @@ |
||
| 30 | 30 | // should return either a User instance or null. You're free to obtain |
| 31 | 31 | // the User instance via an API token or any other method necessary. |
| 32 | 32 | |
| 33 | - $this->app['auth']->viaRequest('api', function ($request) { |
|
| 33 | + $this->app[ 'auth' ]->viaRequest('api', function($request) { |
|
| 34 | 34 | if ($request->input('api_token')) { |
| 35 | 35 | return User::where('api_token', $request->input('api_token'))->first(); |
| 36 | 36 | } |
@@ -7,12 +7,12 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | $api = app('Dingo\Api\Routing\Router'); |
| 10 | -$api->version('v1', function ($api) { |
|
| 10 | +$api->version('v1', function($api) { |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Welcome message. |
| 14 | 14 | */ |
| 15 | - $api->get('/', function () { |
|
| 15 | + $api->get('/', function() { |
|
| 16 | 16 | return 'LaCMS API'; |
| 17 | 17 | }); |
| 18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | // 'middleware' => 'api:auth', // @todo |
| 24 | 24 | 'prefix' => 'images', |
| 25 | 25 | 'namespace' => 'App\Http\Controllers\Api\V1', |
| 26 | - ], function ($api) { |
|
| 26 | + ], function($api) { |
|
| 27 | 27 | $api->get('/', 'ImagesController@index'); |
| 28 | 28 | $api->post('/', 'ImagesController@store'); |
| 29 | 29 | $api->get('/{id}', 'ImagesController@show'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | // 'middleware' => 'foo', |
| 41 | 41 | 'prefix' => 'posts', |
| 42 | 42 | 'namespace' => 'App\Http\Controllers\Api\V1', |
| 43 | - ], function ($api) { |
|
| 43 | + ], function($api) { |
|
| 44 | 44 | $api->get('/', 'PostsController@index'); |
| 45 | 45 | $api->post('/', 'PostsController@store'); |
| 46 | 46 | $api->get('/{id}', 'PostsController@show'); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // 'middleware' => 'foo', |
| 60 | 60 | 'prefix' => 'authors', |
| 61 | 61 | 'namespace' => 'App\Http\Controllers\Api\V1', |
| 62 | - ], function ($api) { |
|
| 62 | + ], function($api) { |
|
| 63 | 63 | $api->get('/', 'AuthorsController@index'); |
| 64 | 64 | $api->post('/', 'AuthorsController@store'); |
| 65 | 65 | $api->get('/{id}', 'AuthorsController@show'); |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | |
| 97 | 97 | $app->router->group([ |
| 98 | 98 | 'namespace' => 'App\Http\Controllers', |
| 99 | -], function ($router) { |
|
| 99 | +], function($router) { |
|
| 100 | 100 | require __DIR__.'/../routes/web.php'; |
| 101 | 101 | }); |
| 102 | 102 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('authors', function (Blueprint $table) { |
|
| 16 | + Schema::create('authors', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('first_name'); |
| 19 | 19 | $table->string('last_name'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('images', function (Blueprint $table) { |
|
| 16 | + Schema::create('images', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('post_id')->unsigned(); |
| 19 | 19 | $table->string('url'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('posts', function (Blueprint $table) { |
|
| 16 | + Schema::create('posts', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('author_id')->unsigned(); |
| 19 | 19 | $table->string('title'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -$factory->define(App\User::class, function (Faker\Generator $faker) { |
|
| 14 | +$factory->define(App\User::class, function(Faker\Generator $faker) { |
|
| 15 | 15 | return [ |
| 16 | 16 | 'name' => $faker->name, |
| 17 | 17 | 'email' => $faker->email, |