'datetime:Y-m-d']; protected $fillable = ['path']; 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()); // return Storage::disk('local')->url( // 'matches/' . $this->getFilename() // ); } }