From 219c54411bb765bebd7813ad3e49ab05acf0b150 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 28 Jul 2019 17:14:42 +0200 Subject: Permissions: Added models and migrations --- src/Models/Team.php | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 src/Models/Team.php (limited to 'src/Models/Team.php') diff --git a/src/Models/Team.php b/src/Models/Team.php new file mode 100644 index 00000000..b6acaadc --- /dev/null +++ b/src/Models/Team.php @@ -0,0 +1,99 @@ +belongsToMany(Role::class) + ->withTimestamps(); + } + + /** + * The users that that support to the team + * + * @return BelongsToMany + */ + public function supporters() + { + return $this + ->belongsToMany(User::class, 'supporter_team') + ->withTimestamps(); + } + + /** + * The users that that belong to the team + * + * @return BelongsToMany + */ + public function users() + { + return $this + ->belongsToMany(User::class) + ->withPivot(['confirmed']) + ->withTimestamps(); + } +} -- cgit v1.2.3-54-g00ecf