mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 16:22:16 +01:00
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\OrganizationFactory;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Laravel\Jetstream\Events\TeamCreated;
|
|
use Laravel\Jetstream\Events\TeamDeleted;
|
|
use Laravel\Jetstream\Events\TeamUpdated;
|
|
use Laravel\Jetstream\Team as JetstreamTeam;
|
|
|
|
/**
|
|
* @property string $id
|
|
* @property string $name
|
|
* @property bool $personal_team
|
|
* @property User $owner
|
|
* @property Collection<User> $users
|
|
*
|
|
* @method HasMany<OrganizationInvitation> teamInvitations()
|
|
* @method static OrganizationFactory factory()
|
|
*/
|
|
class Organization extends JetstreamTeam
|
|
{
|
|
use HasFactory;
|
|
use HasUuids;
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array<string, string>
|
|
*/
|
|
protected $casts = [
|
|
'name' => 'string',
|
|
'personal_team' => 'boolean',
|
|
];
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array<int, string>
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
'personal_team',
|
|
];
|
|
|
|
/**
|
|
* The event map for the model.
|
|
*
|
|
* @var array<string, class-string>
|
|
*/
|
|
protected $dispatchesEvents = [
|
|
'created' => TeamCreated::class,
|
|
'updated' => TeamUpdated::class,
|
|
'deleted' => TeamDeleted::class,
|
|
];
|
|
}
|