employers_main.php 504 Bytes
<?php

namespace App\Models;

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

class employers_main extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'employer_id',
        'sort',
    ];

    /*
    * Связь таблицы employers с таблицей employers_main
    многие-к-одному
   */
    public function employer() {
        return $this->belongsTo(Employer::class, 'employer_id');
    }
}