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