implemented a lot of security measures
This commit is contained in:
@@ -58,7 +58,19 @@ class BlogPost extends Model
|
||||
|
||||
public function bannerUrl(): Attribute
|
||||
{
|
||||
return Attribute::get(fn () => $this->banner ? asset(Storage::url($this->banner)) : '');
|
||||
return Attribute::get(function () {
|
||||
if (! $this->banner) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$path = ltrim($this->banner, '/');
|
||||
|
||||
return \URL::temporarySignedRoute(
|
||||
'api.v1.branding.asset',
|
||||
now()->addMinutes(30),
|
||||
['path' => $path]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public function contentHtml(): Attribute
|
||||
|
||||
Reference in New Issue
Block a user