<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Neighborhood extends Model
{
    protected $fillable = [
        'name',
        'slug',
        'city',
        'tagline',
        'image',
        'description',
        'school_rating',
        'lifestyle_overview',
        'avg_price_per_sqm',
        'commute_cbd',
        'title_status',
        'latitude',
        'longitude',
    ];

    public function properties()
    {
        return Property::where('city', 'like', "%{$this->name}%")
            ->orWhere('address', 'like', "%{$this->name}%");
    }
}
