@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | // use this if your package has routes |
| 32 | 32 | $this->setupRoutes($this->app->router); |
| 33 | 33 | |
| 34 | - if (! class_exists('CreateAssetTable')) { |
|
| 34 | + if (!class_exists('CreateAssetTable')) { |
|
| 35 | 35 | $this->publishes([ |
| 36 | 36 | __DIR__.'/../database/migrations/create_asset_table.php' => database_path('migrations/'.date('Y_m_d_His', |
| 37 | 37 | time()).'_create_asset_table.php'), |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function setupRoutes(Router $router) |
| 63 | 63 | { |
| 64 | - $router->group(['namespace' => 'Thinktomorrow\AssetLibrary\Http\Controllers'], function ($router) { |
|
| 64 | + $router->group(['namespace' => 'Thinktomorrow\AssetLibrary\Http\Controllers'], function($router) { |
|
| 65 | 65 | require __DIR__.'/Http/routes.php'; |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | private function registerAssetLibrary() |
| 94 | 94 | { |
| 95 | - $this->app->singleton('asset', function ($app) { |
|
| 95 | + $this->app->singleton('asset', function($app) { |
|
| 96 | 96 | return new Asset($app); |
| 97 | 97 | }); |
| 98 | 98 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if (! $locale) { |
|
| 34 | + if (!$locale) { |
|
| 35 | 35 | $locale = Locale::getDefault(); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function getAllImages() |
| 73 | 73 | { |
| 74 | - $images = $this->assets->filter(function ($asset) { |
|
| 74 | + $images = $this->assets->filter(function($asset) { |
|
| 75 | 75 | return $asset->getExtensionForFilter() == 'image'; |
| 76 | 76 | }); |
| 77 | 77 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if ($files instanceof self) { |
| 30 | 30 | return $files; |
| 31 | 31 | } elseif (is_array($files)) { |
| 32 | - collect($files)->each(function ($file) use ($list) { |
|
| 32 | + collect($files)->each(function($file) use ($list) { |
|
| 33 | 33 | if ($file instanceof Asset) { |
| 34 | 34 | $list->push($file); |
| 35 | 35 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function uploadToAsset($files, $keepOriginal = false) |
| 59 | 59 | { |
| 60 | - if (! ($files instanceof File) && ! ($files instanceof UploadedFile)) { |
|
| 60 | + if (!($files instanceof File) && !($files instanceof UploadedFile)) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $customProps['dimensions'] = getimagesize($files)[0].' x '.getimagesize($files)[1]; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $fileAdd = $this->addMedia($files)->withCustomProperties($customProps); |
|
| 69 | + $fileAdd = $this->addMedia($files)->withCustomProperties($customProps); |
|
| 70 | 70 | if ($keepOriginal) { |
| 71 | 71 | $fileAdd = $fileAdd->preservingOriginal(); |
| 72 | 72 | } |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $asset = $model->assets->where('pivot.type', $type)->where('pivot.locale', $locale); |
| 97 | 97 | |
| 98 | - if (! $asset->isEmpty() && $asset->first()->pivot->type !== '') { |
|
| 98 | + if (!$asset->isEmpty() && $asset->first()->pivot->type !== '') { |
|
| 99 | 99 | $model->assets()->detach($asset->first()->id); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if (! $locale) { |
|
| 102 | + if (!$locale) { |
|
| 103 | 103 | $locale = Locale::getDefault(); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (config('assetlibrary.conversionPrefix') && $size != '') { |
| 130 | - $conversionName = $media->first()->name . '_' . $size; |
|
| 130 | + $conversionName = $media->first()->name.'_'.$size; |
|
| 131 | 131 | } else { |
| 132 | 132 | $conversionName = $size; |
| 133 | 133 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | $result = '<input type="hidden" value="'.$type.'" name="'; |
| 241 | 241 | |
| 242 | - if (! $locale) { |
|
| 242 | + if (!$locale) { |
|
| 243 | 243 | return $result.$name.'">'; |
| 244 | 244 | } |
| 245 | 245 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | | |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -$factory->define(Article::class, function (Faker $faker) { |
|
| 17 | +$factory->define(Article::class, function(Faker $faker) { |
|
| 18 | 18 | return [ |
| 19 | 19 | ]; |
| 20 | 20 | }); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('asset_pivots', function (Blueprint $table) { |
|
| 16 | + Schema::create('asset_pivots', function(Blueprint $table) { |
|
| 17 | 17 | $table->integer('asset_id'); |
| 18 | 18 | $table->integer('entity_id'); |
| 19 | 19 | $table->string('entity_type'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('assets', function (Blueprint $table) { |
|
| 16 | + Schema::create('assets', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->timestamps(); |
| 19 | 19 | }); |