From 7c8eee3d46a301f92087bbc5101b3432a4faa26f Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 15 Mar 2023 21:37:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20User?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/User.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index 23b4063..f07ace7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -40,5 +40,16 @@ class User extends Authenticatable */ protected $casts = [ 'email_verified_at' => 'datetime', + 'is_admin' => 'boolean', ]; + + public function isAdmin() { + return $this->is_admin; + } + + // tunnels + public function tunnels() + { + return $this->hasMany(Tunnel::class); + } }