new helpdesk module
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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\HasMany;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string $color
|
||||
* @property bool $is_closed
|
||||
*/
|
||||
final class Status extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'helpdesk_statuses';
|
||||
|
||||
/** @var list<string> */
|
||||
protected $fillable = ['name', 'slug', 'color', 'sort_order', 'is_closed'];
|
||||
|
||||
/** @var array<string, string> */
|
||||
protected $casts = ['is_closed' => 'boolean', 'sort_order' => 'integer'];
|
||||
|
||||
/** @return HasMany<Ticket> */
|
||||
public function tickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class, 'status_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user