@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('urls', function (Blueprint $table) { |
|
15 | + Schema::create('urls', function(Blueprint $table) { |
|
16 | 16 | $table->string('uri')->primary(); |
17 | 17 | $table->string('redirects_to')->nullable()->index(); |
18 | 18 | // Nullable morphs_to resource |
@@ -10,19 +10,19 @@ |
||
10 | 10 | public function boot() |
11 | 11 | { |
12 | 12 | $this->publishes([ |
13 | - __DIR__ . '/../database/migrations/' => database_path('migrations') |
|
13 | + __DIR__.'/../database/migrations/' => database_path('migrations') |
|
14 | 14 | ], 'migrations'); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function register() |
18 | 18 | { |
19 | - $this->app['events']->listen('eloquent.saved*', function ($model) { |
|
19 | + $this->app['events']->listen('eloquent.saved*', function($model) { |
|
20 | 20 | if ($model instanceof HasUrlInterface) { |
21 | 21 | $model->saveUri(); |
22 | 22 | } |
23 | 23 | }); |
24 | 24 | |
25 | - $this->app['events']->listen('eloquent.deleted*', function ($model) { |
|
25 | + $this->app['events']->listen('eloquent.deleted*', function($model) { |
|
26 | 26 | if ($model instanceof HasUrlInterface && $model->url) { |
27 | 27 | $model->url->delete(); |
28 | 28 | } |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | protected static function boot() |
22 | 22 | { |
23 | 23 | parent::boot(); |
24 | - static::creating(function (Url $url) { |
|
24 | + static::creating(function(Url $url) { |
|
25 | 25 | $url->created_at = Carbon::now(); |
26 | 26 | }); |
27 | - static::deleting(function (Url $url) { |
|
27 | + static::deleting(function(Url $url) { |
|
28 | 28 | if ($url->redirectedToBy) { |
29 | - $url->redirectedToBy->each(function (Url $url) { |
|
29 | + $url->redirectedToBy->each(function(Url $url) { |
|
30 | 30 | $url->delete(); |
31 | 31 | }); |
32 | 32 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function getUrlAttribute() |
63 | 63 | { |
64 | - return '/' . $this->uri; |
|
64 | + return '/'.$this->uri; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function __toString() |