@@ -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 | |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | |
| 32 | 32 | // Redirect to alias path |
| 33 | 33 | if (in_array($redirectStatus, ['301', '302'])) { |
| 34 | - $params = count($request->all()) ? '?'.http_build_query($request->all()) : ''; |
|
| 34 | + $params = count($request->all()) ? '?' . http_build_query($request->all()) : ''; |
|
| 35 | 35 | |
| 36 | - return redirect(url($urlModel->aliased_path).$params, $redirectStatus); |
|
| 36 | + return redirect(url($urlModel->aliased_path) . $params, $redirectStatus); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // If visited aliased_path |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $parameters = array_wrap($parameters); |
| 16 | 16 | |
| 17 | - if (! empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) { |
|
| 17 | + if (!empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) { |
|
| 18 | 18 | $entity = $parameters[0]; |
| 19 | 19 | if ($alias = optional($entity->urlAlias)->aliased_path) { |
| 20 | 20 | unset($parameters[0]); |
@@ -13,11 +13,11 @@ |
||
| 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 | - $table->string('system_path')->nullable(); // system/article/1 |
|
| 19 | - $table->string('aliased_path')->unique(); // article/some-slug-article |
|
| 20 | - $table->string('type', 25)->nullable(); // null (is alias) | 301 | 302 |
|
| 18 | + $table->string('system_path')->nullable(); // system/article/1 |
|
| 19 | + $table->string('aliased_path')->unique(); // article/some-slug-article |
|
| 20 | + $table->string('type', 25)->nullable(); // null (is alias) | 301 | 302 |
|
| 21 | 21 | $table->string('model_type')->nullable(); |
| 22 | 22 | $table->integer('model_id')->nullable(); |
| 23 | 23 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function register() |
| 37 | 37 | { |
| 38 | - $this->mergeConfigFrom(__DIR__.'/../config/url-aliases.php', 'url-aliases'); |
|
| 38 | + $this->mergeConfigFrom(__DIR__ . '/../config/url-aliases.php', 'url-aliases'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | protected function publishConfig() |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | protected function publishMigrations() |
| 57 | 57 | { |
| 58 | - if (! class_exists('CreateUrlAliasesTable')) { |
|
| 58 | + if (!class_exists('CreateUrlAliasesTable')) { |
|
| 59 | 59 | $timestamp = date('Y_m_d_His', time()); |
| 60 | 60 | |
| 61 | - $migrationPath = __DIR__.'/../database/migrations/create_url_aliases_table.php'; |
|
| 61 | + $migrationPath = __DIR__ . '/../database/migrations/create_url_aliases_table.php'; |
|
| 62 | 62 | $this->publishes([$migrationPath => database_path('/migrations/' . $timestamp . '_create_url_aliases_table.php'), |
| 63 | 63 | ], 'url-aliases-migrations'); |
| 64 | 64 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected function makeBladeDirective() |
| 77 | 77 | { |
| 78 | - \Blade::directive('urlAliasCurrent', function ($expression) { |
|
| 78 | + \Blade::directive('urlAliasCurrent', function($expression) { |
|
| 79 | 79 | |
| 80 | 80 | list($absolute) = explode(', ', $expression); |
| 81 | 81 | |