Laravel Modules as "Internal" Packages? Interesting Demo.

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ย. 2024

ความคิดเห็น • 25

  • @obikwelukyrian6848
    @obikwelukyrian6848 9 หลายเดือนก่อน +8

    The structure makes sense when working with a large team.

    • @medilies
      @medilies 9 หลายเดือนก่อน +4

      makes sense when working on a large project;

  • @BuyCarsTVPakistan
    @BuyCarsTVPakistan 7 หลายเดือนก่อน

    I did this in one of my projects two years back. Still works great.

  • @LoganathanNatarajanlogudotcom
    @LoganathanNatarajanlogudotcom 9 หลายเดือนก่อน

    Thanks for sharing the concept

  • @Артём-щ3с8в
    @Артём-щ3с8в 7 หลายเดือนก่อน +1

    I don't understand, how do they create Filament files in a different namespace?

  • @medilies
    @medilies 9 หลายเดือนก่อน +2

    I tried both in team and solo dev. it was obviously beneficial for the team but it also didn't burden me as a solo dev.
    I just wanna note that I'm bothered by the splitting of migrations per module. Ig it is better to have them in the main app structure.

    • @tasneemwahdan3618
      @tasneemwahdan3618 9 หลายเดือนก่อน

      Yes, I want to split a large project into modules and I am feeling it's going to be a mess 🙃 still thinking from where to start 😵

    • @krekas
      @krekas 9 หลายเดือนก่อน

      @@tasneemwahdan3618 then start with paper and pencil. Write down what modules would come out, what will go to them

    • @chiquito.y.panzon
      @chiquito.y.panzon 6 หลายเดือนก่อน

      Cuando hablamos de un módulo o "bounded context" según algunos diseños entendemos que todo debe estar junto a no ser que se trate especificamente de un módulo o contexto compartido.
      Para resolver su dilema, le traigo un ejemplo: Si un dia quiere desacerse de su módulo, ¿Borrar la carpeta del módulo es suficiente? Si la respuesta es si, enhorabuena! ha construido correctamente su módulo. Si la respuesta es no, ha generado dependencia de su módulo fuera de su ambito, lo que sería una mala practica.
      Para el ejemplo anterior omitimos el registro del módulo en archivos como composer, aunque claro, las importaciones en la estructura general deberian ser dinamicas y adaptables como se muestra en este video.
      En resumen si, cada módulo debe tener sus propias migraciones.

  • @hotzeplotz2345
    @hotzeplotz2345 8 หลายเดือนก่อน

    The packages in app-modules are 'require'd by composer. Does that mean that composer pulls a copy of them into the root/vendor/ folder? So after code updates one would have to run composer install to see the changes?

    • @LaravelDaily
      @LaravelDaily  8 หลายเดือนก่อน

      Good question, I don't think you need to run composer commands after changes. But you should try it out yourself.

    • @hotzeplotz2345
      @hotzeplotz2345 8 หลายเดือนก่อน

      @@LaravelDaily Ok, I looked it up. The app-modules/ dir is specified as a path repository, with the symlink option set to true (which seems to be the default). Composer then installs the packages by creating symlinks in vendor instead of copying. So updates in the code immediately reflect in the output.

  • @Ali_SSN
    @Ali_SSN 9 หลายเดือนก่อน +3

    this project use package 'internachi/modular' to modular system

    • @GavinHewitt
      @GavinHewitt 8 หลายเดือนก่อน

      Came to say this 🙂

  • @jcc5018
    @jcc5018 9 หลายเดือนก่อน

    I'm working on converting my app to module system based on the laracast course. I'm wondering if you have tips for mass refactoring. Php storm keeps freezing just moving a file or two at a time and sometimes refactors names spaces, and sometimes doesnt.
    But if i need to add a similar set of files or code to each module set but often only changing a word or two to account for the module or model name, is there a quick way to create a template to make this happen that you know of?

    • @LaravelDaily
      @LaravelDaily  9 หลายเดือนก่อน

      No, I don't think there's a template for this

    • @jcc5018
      @jcc5018 9 หลายเดือนก่อน

      @LaravelDaily I'm thinking something similar to how you generate the code for your quick admin panel? Was that straight laravel, or did you use JS or something to make it happen.
      I mean it would kind of stink if there was some easy way to make a command that generates the boiler plate or whatever its called, stubs... and simply have a variable that inserts the model or module name.
      It's alright though.. I'll do it manually, just gonna take a while

  • @shubhamsahuSD
    @shubhamsahuSD 9 หลายเดือนก่อน

    Do you have a video on how to include a npm package as dependency while creating a composer package. So when the user installs that composer package that npm package also installs with it

    • @LaravelDaily
      @LaravelDaily  9 หลายเดือนก่อน +1

      You can take a look at Jetstream installation command, it's open source and does something similar to what you need.

  • @8ack2Lobby
    @8ack2Lobby 9 หลายเดือนก่อน +1

    I like it tbh

  • @JohnRoux
    @JohnRoux 9 หลายเดือนก่อน

    Nova components tried to do the same thing, where your teeny tiny overrides to their rigid structure are needed, new package

  • @Flankymanga
    @Flankymanga 9 หลายเดือนก่อน +3

    So basically a git submodules.

    • @medilies
      @medilies 9 หลายเดือนก่อน +2

      Not really. submodule will help you manage the project mororepo VCS-wise. but this approach is the modular monolith approach and composer settings are just used for managing the module namespace.

    • @chiquito.y.panzon
      @chiquito.y.panzon 6 หลายเดือนก่อน

      @@medilies So the dependencies of a module will go in the main Laravel composer.json or in the composer.json of each module? I think it doesn't make sense to only use it for the namespace

  • @kirayamato6128
    @kirayamato6128 7 หลายเดือนก่อน

    i would prefer to do mono repo instead of packages