'datetime:Y-m-d']; protected $fillable = ['path', 'url']; public function match() { return $this->belongsTo(Match::class); } public function getFilename(): string { $parts = explode('/', $this->path); return $parts[count($parts) - 1]; } public function getUrl(): string { return asset('storage/matches/' . $this->getFilename()); } }