Files
cv-roberto/app/Models/Skill.php
Roberto 9df6c0ab46
All checks were successful
Tests / Laravel tests (pull_request) Successful in 3m31s
feat: include testing, factories, git workflow for testing.
2026-06-03 21:23:39 +02:00

27 lines
569 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;
class Skill extends Model implements HasMedia
{
use HasFactory;
use InteractsWithMedia;
protected $fillable = ['title', 'description', 'rating', 'type'];
public function image()
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;
}
}