Completed
Push — master ( 8b5998...7d7753 )
by Martin
03:00
created
src/Traits/HandlesUrlTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -22,6 +22,9 @@
 block discarded – undo
22 22
         return $this->getUrlResourceResponse($url);
23 23
     }
24 24
     
25
+    /**
26
+     * @return Url
27
+     */
25 28
     protected function findUrlByUri($uri)
26 29
     {
27 30
         try {
Please login to merge, or discard this patch.
src/Traits/HasUrlTrait.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * Saves the URI and related URL object for the model.
51 51
      * 
52
-     * @return Luminark\Url\Interfaces\HasUrlInterface URL resource object
52
+     * @return HasUrlTrait URL resource object
53 53
      */
54 54
     public function saveUri($uri = null)
55 55
     {
@@ -119,6 +119,7 @@  discard block
 block discarded – undo
119 119
      * Validates the URL value and makes sure it is unique. Override this 
120 120
      * method if custom validation is needed.
121 121
      * 
122
+     * @param string $uri
122 123
      * @return boolean URI validity status
123 124
      */
124 125
     protected function validateUri($uri)
Please login to merge, or discard this patch.
database/migrations/2015_04_12_000000_create_urls_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/UrlServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Models/Url.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()
Please login to merge, or discard this patch.