Files
isop-mirror/backend/app/Models/Internship.php

53 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Internship extends Model
{
/** @use HasFactory<\Database\Factories\InternshipFactory> */
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'user_id',
'company_id',
'start',
'end',
'year_of_study',
'semester',
'position_description',
'agreement',
'report',
'report_confirmed',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'report_confirmed' => 'boolean',
];
}
public function student()
{
return $this->belongsTo(User::class, 'user_id');
}
public function company()
{
return $this->belongsTo(Company::class, 'company_id');
}
}