Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Fix occurrance
Browse files Browse the repository at this point in the history
  • Loading branch information
Marttin Notta committed Apr 20, 2021
1 parent 5f3734b commit 2c7b94f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ public function getUrlAttribute()

public function getWebpUrlAttribute()
{
return !empty($this->webp_name) ? Storage::url($this->path . $this->webp_name) : null;
/** @var MediaHandler $instance */
$instance = app()->make(MediaHandler::class);
return !empty($this->webp_name) ? $instance->getDisk()->url($this->path . $this->webp_name) : null;
}

public function getImageSizesAttribute($value)
{
/** @var MediaHandler $instance */
$instance = app()->make(MediaHandler::class);

$sizes = json_decode($value, true) ?? [];

foreach ($sizes as $key => $size) {
Expand Down

0 comments on commit 2c7b94f

Please sign in to comment.