33 lines
608 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Owner extends Model
{
use HasFactory;
protected $fillable = [
'name',
'paternal',
'maternal',
'rfc',
'curp',
'address',
];
protected $appends = [
'full_name',
];
protected function fullName(): Attribute
{
return Attribute::make(
get: fn() => trim("{$this->name} {$this->paternal} {$this->maternal}")
);
}
}