Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Vite Helper

Laravel Vite Helper Laravel Package

motomedialab/laravel-vite-helper

A lightweight Laravel package that adds convenient Blade directives and PHP helpers for Vite, simplifying asset resolution, dev-server detection, and script/style tag generation. It works with Vite's manifest and hot file so you can ship frontend assets with less boilerplate.

Deep Wiki
Context7

Laravel Vite Helper simplifies referencing Vite-compiled assets in Laravel applications. It resolves asset paths from the Vite manifest and exposes convenient helpers for Blade templates, so frontend build output can be used without manual path handling.

  • Simple helpers for resolving Vite asset URLs
  • Reads assets from the Vite manifest
  • Supports hot reload during local development
  • Configurable build and manifest paths
  • Graceful fallback for missing assets
Frequently asked questions about Laravel Vite Helper
What is motomedialab/laravel-vite-helper used for?
It is a small Laravel utility for generating absolute URLs to Vite-managed assets. It is aimed at contexts where Laravel's relative asset resolution is not enough, such as emails, notifications, API payloads, signed URLs, PDFs, and cross-domain frontends. It complements Laravel's built-in Vite integration rather than replacing it.
How do I install laravel-vite-helper with Composer?
Install it with Composer using composer require motomedialab/laravel-vite-helper. The package is expected to use Laravel package auto-discovery, so manual service provider registration should normally not be needed. Pin the version in your composer.json and verify the supported Laravel and PHP constraints before adopting it.
Does laravel-vite-helper replace Laravel's default Vite integration?
No. It should be treated as a helper layer on top of Laravel's Vite integration for absolute URL generation. Continue using Laravel's normal Vite setup for manifest handling and asset bundling. Use this package only where you specifically need absolute asset URLs.
How does laravel-vite-helper resolve the absolute base URL for assets?
The package is intended to resolve an absolute public asset base URL, likely from configuration such as APP_URL or a dedicated asset or CDN setting. Confirm the exact precedence in the README and test it against ASSET_URL, trusted proxies, and your CDN configuration. Behind load balancers, validate that the generated scheme and host match your canonical public URLs.
Does it provide Blade directives for Vite script and style tags?
The package overview mentions helpers and Blade directives for working with Vite assets, including generating script and style tags. Check the README for the exact directive names and supported attributes before using them in templates. For non-browser contexts, prefer the helper methods over Blade directives.
How does it behave in queued jobs and Artisan commands?
URL generation in queue workers and console commands has no HTTP request context, so it should rely on explicit configuration rather than the current request. Test absolute URLs from jobs, schedulers, and Artisan commands in a production-like environment. If the base URL is not configured correctly, you may get internal or inconsistent hosts.
Does it respect trusted proxies and X-Forwarded headers?
That depends on how the package resolves the base URL and on your Laravel trusted proxy configuration. If it derives URLs from the request, correct TrustProxies and X-Forwarded-* handling are essential behind load balancers. Test HTTPS, host, and port behavior in staging before production rollout.
Does it support Vite hot reload, SSR, and multiple builds?
The package focuses on absolute URLs for manifest-backed Vite assets, while hot-file or dev-server behavior and SSR should be verified explicitly. Multiple Vite builds or custom manifest paths may require additional configuration. Do not assume parity with Laravel's full Vite plugin features without testing.
What Laravel and PHP versions are supported?
The exact Laravel and PHP version constraints should be checked in the package's composer.json and README. Confirm compatibility against your application matrix before installing. Because community scrutiny may be limited, pin the version and review dependencies.
Is laravel-vite-helper safe to use in production?
It is a low-impact utility, but package maturity signals such as small adoption and unknown repository visibility mean you should review the source and pin the version. Add tests for manifest assets, missing entries, proxy headers, CDN base URLs, and queue or CLI contexts. Keep a small internal wrapper so you can replace or fork the package under its MIT license if maintenance stops.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle