<?php
/*
    * Created by VahabDev in Aparat Live
    * Website: https://pourfi.ir
    * Aparat Live: https://www.aparat.com/vahabdev/live
    * Aparat Channel: https://www.aparat.com/vahabdev
    * Rubika Channel: https://rubika.ir/vahabdev
    * Donate: https://reymit.ir/vahabdev
    * Telegram: https://t.me/vahabdev
*/


namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Page extends Model
{
    protected $fillable = [
        'name',
        'slug',
        'content',
        'count_view',
        'seo_title',
        'seo_description',
        'status'
    ];


    public function getStatusLabelAttribute(): string
    {
        return match($this->attributes['status']) {
            'draft' => 'پیش نویس',
            'published' => 'منتشرشده',
            default => 'پیش نویس',
        };
    }

}
