HOME


sh-3ll 1.0
DIR:/proc/self/root/proc/thread-self/cwd/bright.medisavehealthcarebd.com/app/Models/Admin/
Upload File :
Current File : //proc/self/root/proc/thread-self/cwd/bright.medisavehealthcarebd.com/app/Models/Admin/Blog.php
<?php

namespace App\Models\Admin;

use App\Traits\Shareable;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Blog extends Model
{
    use HasFactory;
    use Sluggable;
    use Shareable;


    /**
     * Return the sluggable configuration array for this model.
     *
     * @return array
     */
    public function sluggable(): array
    {
        return [
            'slug' => [
                'source' => 'title',
                'maxLength'          => null,
                'maxLengthKeepWords' => true,
                'method'             => null,
                'separator'          => '-',
                'unique'             => true,
                'uniqueSuffix'       => null,
                'includeTrashed'     => false,
                'reserved'           => null,
                'onUpdate'           => false
            ]
        ];
    }

    // Share social media
    protected $shareOptions = [
        'columns' => [
            'title' => 'title'
        ],
        'url' => null
    ];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'language_id',
        'category_id',
        'category_name',
        'user_id',
        'author_name',
        'title',
        'desc',
        'short_desc',
        'blog_image',
        'type',
        'slug',
        'view',
        'status',
        'tag',
        'meta_desc',
        'meta_keyword',
        'breadcrumb_status',
        'custom_breadcrumb_image',
    ];

    public function category()
    {
        return $this->belongsTo('App\Models\Admin\Category','category_id','id');
    }

}