Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wizjo's avatar
Level 26

Best strategy of builiding modular app

I wonder about writing CRM system in which would be for eg. following modules:

  • Employers
  • Customers
  • Inquiries
  • Communication
  • Invoices
  • etc.

Now, the management approaches in businesses and the need for modules are different. In some companies, selected modules could be unnecessary and then should be turned off. The problem, however, is that in the views the modules have common parts. For example in customer view I want to show everything which is connected with that user.

So the question is what would be the best code strategy, so I can easily disable individual modules without having to modify the views each time I want to disable some modules. Also doing mess in views with many @ifs, @switch and so on doesnt seem to best approach... Maybe there is a clever way to do some kind of inheritance views?

0 likes
1 reply
ModestasV's avatar

I'd go for packages.

Every single "module" is a package that appears in blade templates with an @include('package.view') which has @can() gates from laravel.

Of course, this might not be ideal but i'd start brainstorming from here :)

Please or to participate in this conversation.