Files
BarangaySystem/app/Models/Property/Property.php
2026-06-06 18:43:00 +08:00

47 lines
851 B
PHP

<?php
declare(strict_types=1);
namespace App\Models\Property;
use App\Models\Model;
use App\Models\User;
class Property extends Model
{
protected ?string $table = 'properties';
protected array $fillable = [
'hashkey',
'name',
'location',
'price',
'status',
'details',
'is_active',
'created_by',
'updated_by',
];
protected array $casts = [
'details' => 'json',
'price' => 'decimal:2',
'is_active' => 'boolean',
];
public function referrals()
{
return $this->hasMany(Referral::class, 'property_id');
}
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
public function updater()
{
return $this->belongsTo(User::class, 'updated_by');
}
}