Skip to content

Commit

Permalink
Access kernel using facade
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Aug 4, 2024
1 parent 13affca commit b588a88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/framework/src/Foundation/Kernel/Hyperlinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Hyde\Foundation\Kernel;

use Hyde\Hyde;
use Hyde\Facades\Config;
use BadMethodCallException;
use Hyde\Support\Models\Route;
Expand Down Expand Up @@ -96,11 +97,11 @@ public function relativeLink(string $destination): string
*/
public function mediaLink(string $destination, bool $validate = false): string
{
if ($validate && ! file_exists($sourcePath = $this->kernel->getMediaDirectory().'/'.$destination)) {
if ($validate && ! file_exists($sourcePath = Hyde::getMediaDirectory().'/'.$destination)) {
throw new FileNotFoundException($sourcePath);
}

return static::withCacheBusting($this->relativeLink($this->kernel->getMediaOutputDirectory().'/'.$destination), $destination);
return static::withCacheBusting($this->relativeLink(Hyde::getMediaOutputDirectory().'/'.$destination), $destination);
}

/**
Expand Down

0 comments on commit b588a88

Please sign in to comment.