wip
This commit is contained in:
@@ -61,8 +61,10 @@ class User extends Authenticatable implements SendsEmail
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function isAdmin()
|
||||
public function isAdmin() {
|
||||
return $this->pivot->role === 'admin' || $this->pivot->role === 'owner';
|
||||
}
|
||||
public function isAdminFromSession()
|
||||
{
|
||||
if (auth()->user()->id === 0) {
|
||||
return true;
|
||||
@@ -89,6 +91,9 @@ class User extends Authenticatable implements SendsEmail
|
||||
});
|
||||
return $found_root_team->count() > 0;
|
||||
}
|
||||
public function personalTeam() {
|
||||
return $this->teams()->where('personal_team', true)->first();
|
||||
}
|
||||
public function teams()
|
||||
{
|
||||
return $this->belongsToMany(Team::class)->withPivot('role');
|
||||
|
||||
@@ -8,4 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Webhook extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
}
|
||||
protected $casts = [
|
||||
'payload' => 'encrypted',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user