mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 03:02:15 +01:00
Updated dependencies; Fixed codeformatting and phpstan
This commit is contained in:
committed by
Constantin Graf
parent
5b7df869ad
commit
d8968399d6
@@ -9,6 +9,7 @@ use Database\Factories\OrganizationFactory;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
@@ -42,7 +43,10 @@ use OwenIt\Auditing\Contracts\Auditable as AuditableContract;
|
||||
class Organization extends JetstreamTeam implements AuditableContract
|
||||
{
|
||||
use Auditable;
|
||||
|
||||
/** @use HasFactory<OrganizationFactory> */
|
||||
use HasFactory;
|
||||
|
||||
use HasUuids;
|
||||
|
||||
/**
|
||||
@@ -110,7 +114,7 @@ class Organization extends JetstreamTeam implements AuditableContract
|
||||
*/
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Jetstream::userModel(), Jetstream::membershipModel())
|
||||
return $this->belongsToMany(User::class, Member::class)
|
||||
->withPivot([
|
||||
'id',
|
||||
'role',
|
||||
@@ -120,6 +124,16 @@ class Organization extends JetstreamTeam implements AuditableContract
|
||||
->as('membership');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the owner of the team.
|
||||
*
|
||||
* @return BelongsTo<User, Organization>
|
||||
*/
|
||||
public function owner(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<Member>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user