Files
cv-roberto/app/Models/Education.php
2025-07-09 01:22:29 +02:00

29 lines
605 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
class Education extends Model implements HasMedia
{
use InteractsWithMedia;
protected $table = 'education';
protected $fillable = [
'opleiding',
'instituut',
'startdatum',
'einddatum',
'beschrijving',
];
public function image()
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;
}
}