Fix Vite asset compilation and usage for default mail template
This commit is contained in:
parent
9843463dcc
commit
1727b832f1
4 changed files with 15 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ use Illuminate\Pagination\Paginator;
|
|||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\Vite;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
|
|
@ -88,6 +89,13 @@ class AppServiceProvider extends ServiceProvider
|
|||
private function sharetoView()
|
||||
{
|
||||
if (!app()->runningInConsole()) {
|
||||
// * VITE ALIASES
|
||||
Vite::macro('image', function (string $asset) {
|
||||
/** @var \Illuminate\Foundation\Vite $self */
|
||||
$self = $this;
|
||||
$self->asset("resources/assets/images/{$asset}");
|
||||
});
|
||||
|
||||
// * FORCE BOOTSTRAP PAGINATOR (or custom if in front)
|
||||
// Early boot, request wont be filled as expected.
|
||||
if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// ASSETS
|
||||
import.meta.glob(["./../assets/images/**"]);
|
||||
|
||||
// UTILITIES
|
||||
import "./utilities/bootstrap";
|
||||
import "./utilities/fontawesome";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// ASSETS
|
||||
import.meta.glob(["./../assets/images/**"]);
|
||||
|
||||
// UTILITIES
|
||||
import "./utilities/bootstrap";
|
||||
import "./utilities/fontawesome";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<img src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Logo">
|
||||
@else
|
||||
{{-- FIXME: Personaliser ca --}}
|
||||
<img src="{{ mix('images/logo.png', 'build') }}" class="logo img-fluid" alt="{{ config('app.name') }}"><br>
|
||||
<img src="{{ Vite::image('logo.png') }}" class="logo img-fluid" alt="{{ config('app.name') }}"><br>
|
||||
{{ $slot }}
|
||||
@endif
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue