@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::table('images', function (Blueprint $table) { |
|
| 16 | + Schema::table('images', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('filename'); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function down() |
| 27 | 27 | { |
| 28 | - Schema::table('images', function (Blueprint $table) { |
|
| 28 | + Schema::table('images', function(Blueprint $table) { |
|
| 29 | 29 | $table->dropColumnIfExists('filename'); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -70,23 +70,23 @@ |
||
| 70 | 70 | ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (! $this->requests->hasFile('file')) { |
|
| 73 | + if (!$this->requests->hasFile('file')) { |
|
| 74 | 74 | return $this->response->array([ |
| 75 | 75 | 'status' => 'error', |
| 76 | 76 | 'message' => 'Invalid request', |
| 77 | - 'errors' => ['Invalid file.',], |
|
| 77 | + 'errors' => [ 'Invalid file.', ], |
|
| 78 | 78 | ]); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! $this->requests->file('file')->isValid()) { |
|
| 81 | + if (!$this->requests->file('file')->isValid()) { |
|
| 82 | 82 | return $this->response->array([ |
| 83 | 83 | 'status' => 'error', |
| 84 | 84 | 'message' => 'Invalid request', |
| 85 | - 'errors' => ['Invalid file upload.',], |
|
| 85 | + 'errors' => [ 'Invalid file upload.', ], |
|
| 86 | 86 | ]); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $slug = uniqid().'_'.str_slug(explode('.', $this->requests->file->getClientOriginalName())[0]); |
|
| 89 | + $slug = uniqid().'_'.str_slug(explode('.', $this->requests->file->getClientOriginalName())[ 0 ]); |
|
| 90 | 90 | $filename = $slug.'.'.$this->requests->file->extension(); |
| 91 | 91 | |
| 92 | 92 | // move image |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | App\Console\Kernel::class |
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | -$app->singleton('filesystem', function ($app) { |
|
| 51 | +$app->singleton('filesystem', function($app) { |
|
| 52 | 52 | return $app->loadComponent('filesystems', 'Illuminate\Filesystem\FilesystemServiceProvider', 'filesystem'); |
| 53 | 53 | }); |
| 54 | 54 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $app->router->group([ |
| 103 | 103 | 'namespace' => 'App\Http\Controllers', |
| 104 | -], function ($router) { |
|
| 104 | +], function($router) { |
|
| 105 | 105 | require __DIR__.'/../routes/web.php'; |
| 106 | 106 | }); |
| 107 | 107 | |
@@ -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'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | // 'middleware' => 'foo', |
| 43 | 43 | 'prefix' => 'posts', |
| 44 | 44 | 'namespace' => 'App\Http\Controllers\Api\V1', |
| 45 | - ], function ($api) { |
|
| 45 | + ], function($api) { |
|
| 46 | 46 | $api->get('/', 'PostsController@index'); |
| 47 | 47 | $api->post('/', 'PostsController@store'); |
| 48 | 48 | $api->get('/{id}', 'PostsController@show'); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // 'middleware' => 'foo', |
| 63 | 63 | 'prefix' => 'authors', |
| 64 | 64 | 'namespace' => 'App\Http\Controllers\Api\V1', |
| 65 | - ], function ($api) { |
|
| 65 | + ], function($api) { |
|
| 66 | 66 | $api->get('/', 'AuthorsController@index'); |
| 67 | 67 | $api->post('/', 'AuthorsController@store'); |
| 68 | 68 | $api->get('/{id}', 'AuthorsController@show'); |