// SYSTEM PANEL //
[ROOT]
/
mnt
/
pleskStorage
/
vhosts
/
kodsolutions.net
/
subdomains
/
syaaraa.kodsolutions.net
/
app
/
Models
/
Property
[ PARENT ]
EDIT :: Category.php
<?php namespace App\Models\Property; use App\Helpers\Constants; use App\Models\Model; use Spatie\Translatable\HasTranslations; use Illuminate\Database\Eloquent\Factories\HasFactory; class Category extends Model { use HasFactory; use HasTranslations; public $translatable = ['title']; protected $fillable = [ 'title', 'position', 'active', 'image', 'icon', 'slug', 'type', //Property or Types(apartment-house...) ]; public function scopeCategory($query) { return $query->where('type', Constants::APARTMENT_CATEGORY); } public function scopeType($query) { return $query->where('type', Constants::APARTMENT_TYPE); } public function scopeFeature($query) { return $query->where('type', Constants::APARTMENT_FEATURE); } public function scopePropertyStatus($query) { return $query->where('type', Constants::APARTMENT_STATUS); } public function scopePropertyAge($query) { return $query->where('type', Constants::APARTMENT_AGE); } public function getIconPathAttribute() { $value = $this->icon; if ($value != '') { $value = asset($value); } else { $value = asset('/default.jpeg'); } return $value; } }
SAVE
CANCEL