Download the PHP package toanld/modules-inertia without Composer
On this page you can find all versions of the php package toanld/modules-inertia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package modules-inertia
Modules-Inertia
The package is designed to be used by Vue/InertiaJs in conjunction with Laravel-Modules
Laravel compatibility
Laravel | modules-inertia |
---|---|
6.0-10.x | 0.0.x |
Installation
Install the package via composer.
Config Files
In order to edit the default configuration you may execute:
Autoloading
By default, the module classes are not loaded automatically. You can autoload your modules using psr-4. For example:
Tip: don't forget to run composer dump-autoload
afterwards.
Routing
Module routes must contain middleware in your App\Http\Kernel, as the last item in your web middleware group.
Usage
By default, Vue module files are created in the module directory Resources/Pages
You can change the default directory in config/modules.php
For use in Controller
The default value of Inertia::render() in a module has been changed to Inertia::module().
Inertia::render() is still available by default. It can be used outside of modules
module_name
- real name of the current modulefile_name
- real name of the file (no extension .vue)directory_name
- if you have nested display folder structure ( you can specify the file path separating by a dot )
For example:
If you use Vue version 2
If you use Vue version 3
Aliases
For the convenience of specifying the path from the root directory to the module directory, you can add alias in webpack.mix.js
For the convenience of specifying the path from the root directory to the module directory, you can add alias in vite.config.js
Console command
You can run php artisan module:publish-stubs
to publish stubs.
And override the generation of default files
After create module
To be VueJS able to find the created module, you need to rebuild the script
Documentation
You'll find installation instructions and full documentation on https://docs.laravelmodules.com/.
Authors
- Nicolas Widart
- Yaroslav Fedan
- Add your clickable username here. It should point to your GitHub account.
License
The MIT License (MIT). Please see License File for more information.