Przeglądaj źródła

Add new method to User model

Daniel Supernault 7 lat temu
rodzic
commit
7e78261081
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      app/User.php

+ 5 - 0
app/User.php

@@ -31,4 +31,9 @@ class User extends Authenticatable
     {
     {
         return $this->hasOne(Profile::class);
         return $this->hasOne(Profile::class);
     }
     }
+
+    public function url()
+    {
+        return url('/' . $this->username);
+    }
 }
 }