migrant-web/app/Models/JobOffer.php
2026-05-21 10:39:23 +05:30

37 lines
658 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class JobOffer extends Model
{
use HasFactory;
protected $fillable = [
'employer_id',
'worker_id',
'work_date',
'location',
'salary',
'notes',
'status',
];
protected $casts = [
'work_date' => 'date',
'salary' => 'decimal:2',
];
public function employer()
{
return $this->belongsTo(User::class, 'employer_id');
}
public function worker()
{
return $this->belongsTo(Worker::class, 'worker_id');
}
}