$invoices * @property-read mixed $value * @method static \Database\Factories\CompanyFactory factory($count = null, $state = []) * @mixin \Eloquent */ class Company extends Model { use HasFactory; /** * The attributes that are fillable. * * @var array */ protected $fillable = [ 'name' ]; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = [ 'value' ]; /** * HasMany Invoices * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function invoices() { return $this->hasMany(Invoice::class); } /** * Return value attribute for belongsto search component * * @return \Illuminate\Database\Eloquent\Casts\Attribute */ protected function value(): Attribute { return new Attribute( get: fn () => $this->id, ); } }