<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;
class Page extends Model {
use HasTranslations;
protected $fillable = ['slug','title','content','excerpt','banner_image','meta_title','meta_description','og_image','canonical_url','is_active','sort_order'];
public $translatable = ['title','content','excerpt','meta_title','meta_description'];
protected $casts = ['is_active' => 'boolean'];
public function scopeActive($q) { return $q->where('is_active', true); }
public function getRouteKeyName() { return 'slug'; }
}