mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
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.
20 lines
490 B
PHP
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);
|
|
}
|
|
}
|