This commit is contained in:
Andras Bacsai
2023-07-14 11:27:08 +02:00
parent cac59e4873
commit cbefbb7927
29 changed files with 447 additions and 141 deletions

View File

@@ -12,6 +12,7 @@ use Spatie\SchemalessAttributes\SchemalessAttributesTrait;
class InstanceSettings extends Model implements SendsEmail
{
use Notifiable, SchemalessAttributesTrait;
protected $guarded = [];
protected $schemalessAttributes = [
'smtp',
];

View File

@@ -61,7 +61,8 @@ 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()
@@ -91,7 +92,8 @@ class User extends Authenticatable implements SendsEmail
});
return $found_root_team->count() > 0;
}
public function personalTeam() {
public function personalTeam()
{
return $this->teams()->where('personal_team', true)->first();
}
public function teams()