migrant-web/app/Models/EmployerReview.php

38 lines
691 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EmployerReview extends Model
{
use HasFactory;
protected $table = 'employer_reviews';
protected $fillable = [
'worker_id',
'employer_id',
'job_id',
'rating',
'title',
'comment',
];
public function worker()
{
return $this->belongsTo(Worker::class, 'worker_id');
}
public function employer()
{
return $this->belongsTo(User::class, 'employer_id');
}
public function jobPost()
{
return $this->belongsTo(JobPost::class, 'job_id');
}
}