Static_ad.php 570 Bytes
<?php

namespace App\Models;

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

class Static_ad extends Model
{
    use HasFactory;

    protected $fillable = [
        'ad_employer_id',
        'lookin',
        'year_month',
        'message',
        'old_lookin',
        'old_message'
    ];

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