Like_worker.php 452 Bytes
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Like_worker extends Model
{
    public $table = 'like_worker';

    public $fillable = [
        'code_record',
        'user_id'
    ];

    public function worker() {
        return $this->hasMany(Worker::class);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

}