28 lines
655 B
PHP
28 lines
655 B
PHP
<?php
|
|
|
|
namespace App\Modules\Client\Models;
|
|
|
|
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;
|
|
|
|
class Client extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
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);
|
|
}
|
|
}
|