Current File : /home/tradevaly/demo.tradevaly.com.bd/app/Models/NewsCategory.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class NewsCategory extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $fillable = [
        'created_user_id', 'modified_user_id', 'deleted_user_id', 'name', 'slug', 'status', 'updated_at'
    ];


    protected function getCategoryList($conditions = [])
    {
        $data = NewsCategory::where($conditions)->orderBy('name', 'ASC')->pluck('name', 'id')->toArray();
       
        //dd($data);
        
        return $data;
    }


    protected function getCategoryWithSlugList($conditions = [])
    {
        $data = NewsCategory::where($conditions)->orderBy('name', 'ASC')->pluck('name', 'slug')->toArray();
       
        //dd($data);
        
        return $data;
    }


   

}