Category.php 531 Bytes
<?php

namespace App\Models;

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

class Category extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'is_remove'
        ];

    public function scopeActive($query) {
        return $query->where('is_remove', '=', '0');
    }

    // Один ко многим Категории - к - вакансиям
    public function ad_employers() {
        return $this->hasMany(ad_employer::class);
    }
}