@@ -78,7 +78,7 @@ |
||
78 | 78 | |
79 | 79 | public function customize($request, Closure $next) |
80 | 80 | { |
81 | - //... |
|
81 | + //... |
|
82 | 82 | return $next($request); |
83 | 83 | } |
84 | 84 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('url_aliases', function (Blueprint $table) { |
|
16 | + Schema::create('url_aliases', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('source')->index(); |
19 | 19 | $table->string('alias')->unique(); |
@@ -42,11 +42,11 @@ |
||
42 | 42 | //'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'], |
43 | 43 | //'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''], |
44 | 44 | //'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''], |
45 | - 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'], |
|
45 | + 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'], |
|
46 | 46 | //'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'], |
47 | 47 | //'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'], |
48 | 48 | //'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'], |
49 | - 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], |
|
49 | + 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], |
|
50 | 50 | //'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''], |
51 | 51 | //'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'], |
52 | 52 | //'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''], |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | $order = $this->config->get('url-aliases-laravellocalization.localesOrder'); |
70 | 70 | |
71 | - uksort($locales, function ($a, $b) use ($order) { |
|
71 | + uksort($locales, function($a, $b) use ($order) { |
|
72 | 72 | $pos_a = array_search($a, $order); |
73 | 73 | $pos_b = array_search($b, $order); |
74 | 74 | return $pos_a - $pos_b; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function __construct($app = null) |
24 | 24 | { |
25 | 25 | if (!$app) { |
26 | - $app = app(); //Fallback when $app is not given |
|
26 | + $app = app(); //Fallback when $app is not given |
|
27 | 27 | } |
28 | 28 | $this->app = $app; |
29 | 29 | |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | { |
35 | 35 | $parameters = array_wrap($parameters); |
36 | 36 | |
37 | - if (! empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) { |
|
37 | + if (!empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) { |
|
38 | 38 | $entity = $parameters[0]; |
39 | 39 | if ($entity->urlAlias) { |
40 | 40 | unset($parameters[0]); |
41 | 41 | |
42 | - if (! $forceWithLocalePreffix && $this->config->get('app.locale') == $entity->urlAlias->locale && $this->config->get('url-aliases-laravellocalization.hideDefaultLocaleInURL')) { |
|
42 | + if (!$forceWithLocalePreffix && $this->config->get('app.locale') == $entity->urlAlias->locale && $this->config->get('url-aliases-laravellocalization.hideDefaultLocaleInURL')) { |
|
43 | 43 | $alias = $entity->urlAlias->alias; |
44 | 44 | } else { |
45 | 45 | $alias = $entity->urlAlias->localeAlias; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | return []; |
42 | 42 | } |
43 | 43 | |
44 | - return ! is_array($value) ? [$value] : $value; |
|
44 | + return !is_array($value) ? [$value] : $value; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $segments = explode('/', $path); |
92 | 92 | |
93 | - $array = array_values(array_filter($segments, function ($value) { |
|
93 | + $array = array_values(array_filter($segments, function($value) { |
|
94 | 94 | return $value !== ''; |
95 | 95 | })); |
96 | 96 |
@@ -12,8 +12,8 @@ |
||
12 | 12 | |
13 | 13 | protected static function boot() |
14 | 14 | { |
15 | - static::creating(function (Model $model) { |
|
16 | - if (! $model->locale) { |
|
15 | + static::creating(function(Model $model) { |
|
16 | + if (!$model->locale) { |
|
17 | 17 | $model->locale = app()->app['config']->get('app.locale'); |
18 | 18 | } |
19 | 19 | }); |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function register() |
34 | 34 | { |
35 | - $this->mergeConfigFrom(__DIR__.'/../config/url-aliases.php', 'url-aliases'); |
|
36 | - $this->mergeConfigFrom(__DIR__.'/../config/url-aliases-laravellocalization.php', 'url-aliases-laravellocalization'); |
|
35 | + $this->mergeConfigFrom(__DIR__ . '/../config/url-aliases.php', 'url-aliases'); |
|
36 | + $this->mergeConfigFrom(__DIR__ . '/../config/url-aliases-laravellocalization.php', 'url-aliases-laravellocalization'); |
|
37 | 37 | |
38 | - $this->app->singleton(UrlAliasLocalization::class, function () { |
|
38 | + $this->app->singleton(UrlAliasLocalization::class, function() { |
|
39 | 39 | return new UrlAliasLocalization($this->app); |
40 | 40 | }); |
41 | 41 | |
42 | - $this->app->singleton(UrlAlias::class, function () { |
|
42 | + $this->app->singleton(UrlAlias::class, function() { |
|
43 | 43 | return new UrlAlias($this->app); |
44 | 44 | }); |
45 | 45 | } |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function publishMigrations() |
64 | 64 | { |
65 | - if (! class_exists('CreateUrlAliasesTable')) { |
|
65 | + if (!class_exists('CreateUrlAliasesTable')) { |
|
66 | 66 | $timestamp = date('Y_m_d_His', time()); |
67 | 67 | |
68 | - $migrationPath = __DIR__.'/../database/migrations/create_url_aliases_table.php'; |
|
68 | + $migrationPath = __DIR__ . '/../database/migrations/create_url_aliases_table.php'; |
|
69 | 69 | $this->publishes([$migrationPath => database_path('/migrations/' . $timestamp . '_create_url_aliases_table.php'), |
70 | 70 | ], 'url-aliases-migrations'); |
71 | 71 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function __construct($app) |
26 | 26 | { |
27 | 27 | if (!$app) { |
28 | - $app = app(); //Fallback when $app is not given |
|
28 | + $app = app(); //Fallback when $app is not given |
|
29 | 29 | } |
30 | 30 | $this->app = $app; |
31 | 31 |