1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 03:14:04 +00:00
tenancy/src/Vite.php
Bert Bredewold 8f835ba3b6
Use assetPathResolver closure if set
The original Vite Facade uses the assetPathResolver closure (if set) to generate assets with a custom URL. This is needed when for example assets are cached on a CDN, or if you need assets from a central URL while in Tenant context.

This updates the Tenancy version of the Vite-Facade to bring back the assetPathResolver logic.
2024-05-13 11:18:06 +02:00

20 lines
490 B
PHP

<?php
namespace Stancl\Tenancy;
use Illuminate\Foundation\Vite as BaseVite;
class Vite extends BaseVite // todo move to a different directory in v4
{
/**
* Generate an asset path for the application.
*
* @param string $path
* @param bool|null $secure
* @return string
*/
protected function assetPath($path, $secure = null)
{
return $this->assetPathResolver ? ($this->assetPathResolver)($path, $secure) : global_asset($path);
}
}