Skip to content

Component Generator

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

php artisan modular:make-component Customer CustomerReport

Or if you are using Laravel Sail, run:

sail artisan modular:make-component Customer CustomerReport

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

├── Components
│   └── CustomerReport.vue
├── CustomerForm.vue
└── CustomerIndex.vue

This way, you can easily import local components required by the main Pages (for example, Page ./resources/js/Pages/Customer/CustomerIndex.vue), keeping these main Pages cleaner and organized.

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

<script setup>
import CustomerReport from "./Components/CustomerReport.vue";