Sfoglia il codice sorgente

Add new method to User model

Daniel Supernault 7 anni fa
parent
commit
7e78261081
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      app/User.php

+ 5 - 0
app/User.php

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