Download the PHP package motomedialab/laravel-vite-helper without Composer
On this page you can find all versions of the php package motomedialab/laravel-vite-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download motomedialab/laravel-vite-helper
More information about motomedialab/laravel-vite-helper
Files in motomedialab/laravel-vite-helper
Package laravel-vite-helper
Short Description A helper method to generate absolute asset URL's to Vite assets
License MIT
Homepage https://github.com/motomedialab/laravel-vite-helper
Informations about the package laravel-vite-helper
Laravel vite()
helper method
A super simple Laravel helper to fill the void that Laravel Mix left. Mix had a helper, aptly named mix()
that would return an absolute URL to the mix resource. With the introduction of Vite (as of Laravel 9.19),
there is no equivalent for Vite, at least, until now.
This was originally submitted as a PR to the core Laravel framework, but unfortunately wasn't deemed as a necessary addition.
Installation
You can install the package via composer:
Usage
The usage for this helper is extremely simple, and directly replaces Laravel's mix()
helper.
Mocking in your own tests
Using this helper may cause some tests that directly interact with your web pages to break if you don't have the compiled assets available (e.g. in a CI/CD flow).
To overcome this, there's a MocksViteHelper
trait that can be used within your tests:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.