<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Traits\Scope\CategoryScope;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Traits\Attribute\CategoryAttribute;
use App\Models\Traits\Method\CategoryMethod;

/**
 * Class Category.
 */
class Category extends Model
{
    use SoftDeletes,
        CategoryScope,
        CategoryMethod,
        CategoryAttribute;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'category_name',
        'category_image',
        'active'
    ];

    /**
     * @var array
     */
    protected $dates = ['deleted_at'];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'active' => 'boolean'
    ];

    /**
     * Get the service users associated with the services.
     */
    public function serviceProviderService()
    {
        return $this->hasMany('App\Models\ServiceProviderToService');
    }
}
