1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 20:14:04 +00:00

Add Vite helper for tenancy

This commit is contained in:
Wilsen Hernández 2022-09-23 00:36:02 -04:00
parent 53a9d24b7c
commit 75cb428372
2 changed files with 24 additions and 0 deletions

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy; namespace Stancl\Tenancy;
use Illuminate\Cache\CacheManager; use Illuminate\Cache\CacheManager;
use Illuminate\Foundation\Vite as BaseVite;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper; use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper;
@ -64,10 +65,13 @@ class TenancyServiceProvider extends ServiceProvider
$this->app->singleton(Commands\Rollback::class, function ($app) { $this->app->singleton(Commands\Rollback::class, function ($app) {
return new Commands\Rollback($app['migrator']); return new Commands\Rollback($app['migrator']);
}); });
$this->app->singleton(Commands\Seed::class, function ($app) { $this->app->singleton(Commands\Seed::class, function ($app) {
return new Commands\Seed($app['db']); return new Commands\Seed($app['db']);
}); });
$this->app->singleton(BaseVite::class, Vite::class);
$this->app->bind('globalCache', function ($app) { $this->app->bind('globalCache', function ($app) {
return new CacheManager($app); return new CacheManager($app);
}); });

20
src/Vite.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Stancl\Tenancy;
use Illuminate\Foundation\Vite as BaseVite;
class Vite extends BaseVite
{
/**
* Generate an asset path for the application.
*
* @param string $path
* @param bool|null $secure
* @return string
*/
protected function assetPath($path, $secure = null)
{
return global_asset($path);
}
}