plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature Request]: Support new Filament v4 resource structure

Open GrameJunior opened this issue 3 months ago • 2 comments

Feature Description

Filament introduced a new suggested folder structure for their resources within v4: https://filamentphp.com/docs/4.x/resources/overview#creating-a-resource

Right now the plugin still generates it the old way while Filament v4 is installed.

v3:

  • Resources
    • OrderResource
      • Pages
      • ...
    • OrderResource.php

v4:

  • Resources
    • Orders
      • Pages
      • ...
      • OrderResource.php

GrameJunior avatar Oct 08 '25 13:10 GrameJunior

Hi. Yes, it's on our list. BTW, do you know if this behaviour can be configured somehow? Maybe in the config file?

adelf avatar Oct 08 '25 14:10 adelf

Hi. Yes, it's on our list. BTW, do you know if this behaviour can be configured somehow? Maybe in the config file?

I just know that you can keep the old structure with feature flags:

  • https://github.com/filamentphp/filament/blob/bd50530a3a9f233cf560442b98a243f95ea49efe/packages/support/config/filament.php#L104
  • https://filamentphp.com/docs/4.x/upgrade-guide#publishing-the-configuration-file

So this configuration within v4 will generate the resources like in the v3:

'file_generation' => [
    'flags' => [
        Filament\Support\Commands\FileGenerators\FileGenerationFlag::PANEL_RESOURCE_CLASSES_OUTSIDE_DIRECTORIES
    ],
],

GrameJunior avatar Oct 08 '25 14:10 GrameJunior