Repo rebuild
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Helpdesk\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules\Company\Models\Company;
|
||||
|
||||
final class Team extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'helpdesk_teams';
|
||||
|
||||
/** @var list<string> */
|
||||
protected $fillable = ['company_id', 'name', 'slug', 'color', 'description', 'archived_at', 'is_default'];
|
||||
|
||||
/** @var array<string, string> */
|
||||
protected $casts = [
|
||||
'company_id' => 'integer',
|
||||
'archived_at' => 'datetime',
|
||||
'is_default' => 'boolean',
|
||||
];
|
||||
|
||||
/** @return BelongsTo<Company, Team> */
|
||||
public function company(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Company::class, 'company_id');
|
||||
}
|
||||
|
||||
/** @return HasMany<Project> */
|
||||
public function projects(): HasMany
|
||||
{
|
||||
return $this->hasMany(Project::class, 'team_id');
|
||||
}
|
||||
|
||||
/** @return HasMany<Ticket> */
|
||||
public function tickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class, 'team_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user