2026-06-23 10:10:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Modules\Client\Models;
|
|
|
|
|
|
2026-07-18 09:34:18 +00:00
|
|
|
use App\Modules\CustomField\Models\CustomFieldValue;
|
2026-06-23 10:10:28 +00:00
|
|
|
use App\Modules\History\Models\HistoryEntry;
|
|
|
|
|
use Database\Factories\ClientFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2026-07-18 09:34:18 +00:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2026-06-23 10:10:28 +00:00
|
|
|
|
|
|
|
|
class Client extends Model
|
|
|
|
|
{
|
2026-07-18 09:34:18 +00:00
|
|
|
use HasFactory, SoftDeletes;
|
2026-06-23 10:10:28 +00:00
|
|
|
|
|
|
|
|
protected $fillable = ['client_number', 'name', 'notes'];
|
|
|
|
|
|
|
|
|
|
protected $casts = ['notes' => 'array'];
|
|
|
|
|
|
|
|
|
|
protected static function newFactory(): ClientFactory
|
|
|
|
|
{
|
|
|
|
|
return ClientFactory::new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function historyEntries(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(HistoryEntry::class);
|
|
|
|
|
}
|
2026-07-18 09:34:18 +00:00
|
|
|
|
|
|
|
|
public function customFieldValues(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(CustomFieldValue::class);
|
|
|
|
|
}
|
2026-06-23 10:10:28 +00:00
|
|
|
}
|