Skip to content

Composable Generator

The Composable Generator Command, will create a new Vue Composable for the provided Module with a very basic boilerplate code. If you want to create a new ReportComposable file, for the Customer Module, you can run the following command:

php artisan modular:make-composable Customer ReportComposable

Or if you are using Laravel Sail, run:

sail artisan modular:make-composable Customer ReportComposable

And a new ReportComposable.vue file will be created at resources/js/Modules/Customer/Composables folder.

├── Components
│   └── CustomerReport.vue
├── Composables
│   └── useReportComposable.js
├── CustomerForm.vue
└── CustomerIndex.vue

This way, you can easily import local composables required by your Components, keeping your Components cleaner and organized.

<!-- ./resources/js/Pages/Customer/CustomerReport.vue -->

<script setup>
import useReportComposable from './Composables/useReportComposable'