<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Categories extends Model
{
    protected $table = 'categories';

    protected $fillable = [
        'name',
        'image',
        'created_by'
    ];

    public function subCategories()
    {
        return $this->hasMany(
            SubCategories::class,
            'category_id'
        )->orderBy('name');
    }

    public function bankQuestions()
    {
        return $this->hasMany(
            BankQuestion::class,
            'category_id'
        );
    }

}