29 lines
701 B
PHP
29 lines
701 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\CustomField\Models;
|
||
|
|
|
||
|
|
use App\Models\User;
|
||
|
|
use App\Modules\Client\Models\Client;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class CustomFieldValue extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = ['client_id', 'custom_field_definition_id', 'value', 'author_id'];
|
||
|
|
|
||
|
|
public function client(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Client::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function definition(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(CustomFieldDefinition::class, 'custom_field_definition_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function author(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'author_id');
|
||
|
|
}
|
||
|
|
}
|