All checks were successful
Tests / Laravel tests (pull_request) Successful in 2m36s
38 lines
822 B
PHP
38 lines
822 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Spatie\MediaLibrary\HasMedia;
|
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
|
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
|
|
|
class Education extends Model implements HasMedia
|
|
{
|
|
/** @use HasFactory<\Database\Factories\EducationFactory> */
|
|
use HasFactory;
|
|
|
|
use InteractsWithMedia;
|
|
|
|
protected $table = 'education';
|
|
|
|
protected $fillable = [
|
|
'opleiding',
|
|
'instituut',
|
|
'startdatum',
|
|
'einddatum',
|
|
'beschrijving',
|
|
];
|
|
|
|
public function image(): ?Media
|
|
{
|
|
return $this->getFirstMedia('image');
|
|
}
|
|
|
|
public function imageUrl(): ?string
|
|
{
|
|
return $this->image() ? $this->image()->getUrl() : null;
|
|
}
|
|
}
|