laravel-modules icon indicating copy to clipboard operation
laravel-modules copied to clipboard

Support for Inertia.js

Open rohitshakyaa opened this issue 8 months ago • 9 comments

Description

Currently, integrating Inertia.js with Laravel Modules requires manual setup, and there are multiple ways to implement it. However, it would be beneficial if Laravel Modules provided built-in support for Inertia.js by default. This would streamline the integration process and ensure consistency across modules.

Why is this needed?

  • Inertia.js is widely used with Laravel for building modern SPA applications.
  • Setting up Inertia within a module requires additional configuration, which could be automated or simplified.
  • Default support would make module development with Inertia more seamless.

rohitshakyaa avatar Mar 10 '25 07:03 rohitshakyaa

Yes, would be good to have this supported. I'll look into options.

dcblogdev avatar Mar 10 '25 09:03 dcblogdev

Nice to have.

solomon-ochepa avatar Mar 10 '25 15:03 solomon-ochepa

Description

Currently, integrating Inertia.js with Laravel Modules requires manual setup, and there are multiple ways to implement it. However, it would be beneficial if Laravel Modules provided built-in support for Inertia.js by default. This would streamline the integration process and ensure consistency across modules.

Why is this needed?

  • Inertia.js is widely used with Laravel for building modern SPA applications.
  • Setting up Inertia within a module requires additional configuration, which could be automated or simplified.
  • Default support would make module development with Inertia more seamless.

Some sample code and links would be highly beneficial.

solomon-ochepa avatar Mar 10 '25 15:03 solomon-ochepa

Description

Currently, integrating Inertia.js with Laravel Modules requires manual setup, and there are multiple ways to implement it. However, it would be beneficial if Laravel Modules provided built-in support for Inertia.js by default. This would streamline the integration process and ensure consistency across modules.

Why is this needed?

  • Inertia.js is widely used with Laravel for building modern SPA applications.
  • Setting up Inertia within a module requires additional configuration, which could be automated or simplified.
  • Default support would make module development with Inertia more seamless.

I use Laravel 12 with inertiajs without problems, inclusive with multitenant, WhatsApp, telegram, payments, mercado libre api, shopify api, social login, sockets, etc.

Explain what do you need to do

yashiroiori avatar Mar 22 '25 07:03 yashiroiori

What would be the steps to implement modules in an Inertia Vuejs Laravel project?

yorkcorpthe avatar May 04 '25 04:05 yorkcorpthe

What would be the steps to implement modules in an Inertia Vuejs Laravel project?

  1. composer require nwidart/laravel-modules
  2. Create module
  3. Change view('page.blade') to inertia('path_to_vue_file'), in this case I use the module folder resources/assets/js/ to put react/vue files and into file app.js modify to search into "Modules" path the vue files

This is an old config I use into vue, actually use raect, it's old core I made https://github.com/yashiroiori/erp-tabler/blob/b2d6530bf00666f8ad665ed86e46069e2e26ebf1/resources/js/app.js#L93

This way to call file vue from controller, check package to view how work inertia with vue into modules https://github.com/yashiroiori/aclmanagertabler/blob/06349cd44443fe133d6e1930997abb589d656bc8/src/Http/Controllers/RoleController.php#L39

yashiroiori avatar May 05 '25 21:05 yashiroiori

It would very very beneficiary. No doubt. I'ill look into options.

tajik2020 avatar May 07 '25 06:05 tajik2020

Yes I agree with that

destroylord avatar Jun 26 '25 05:06 destroylord

Yes I agree with thatx2

yorkcorpthe avatar Jun 27 '25 18:06 yorkcorpthe