ailixir-api / app /Models /Scientist.php
AILIXIR Bot
Auto-sync: 201d269f287526269b8ffded5f450ff36b46c740
907b200
Raw
History Blame Contribute Delete
547 Bytes
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Scientist extends Model
{
protected $fillable = [
'name',
'nationality',
'birth_year',
'death_year',
'images',
'bio',
'impact',
'field'
];
protected $casts = [
'images' => 'array',
];
public function awards()
{
return $this->belongsToMany(Award::class, 'award_scientist')
->withPivot('year_won', 'contribution')
->withTimestamps();
}
}