Ad_jobs.php 858 Bytes
<?php

namespace App\Models;

use Filament\Tables\Actions\Position;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Ad_jobs extends Model
{
    use HasFactory;

    protected $table = 'ad_jobs';

    public $fillable = [
        'ad_employer_id',
        'job_title_id',
        'flot',
        'min_salary',
        'max_salary',
        'region',
        'sytki',
        'start',
        'description',
        'position_ship',
        'power'
    ];

    public function job_title() {
        return $this->belongsTo(Job_title::class, 'job_title_id');
    }

    public function positions() {
        return $this->belongsToMany(Positions::class, 'job_titles');
    }

    public function categoria() {
        return $this->belongsToMany(Category::class, 'job_titles', 'id', 'position_id');
    }
}