Custom (default) namespace for commands #17198
steelvirus
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Yes, we should use the configured Laravel namespace there. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue
Currently, filament does not allow for custom namespaces in (some) commands, like the make:filament-panel command, it will always use
App\\
as prefix. Some commands allow for a custom namespace to be provided as an option. When using a namespace different fromApp\\
, for example when developing a plugin/package (which is my use case) it would be a real improvement DX wise. Laravel itself already allows for custom namespaces (and paths).Solution
I propose the following solution: Use the laravel namespace (which is derived from the current
Application
instance) as the default for all file generating commands. Also use this namespace when auto-resolving classes (might already work this way, should be verified). An alternative solution would be to add an option to the filament config, this however would create a second source of truth for the root-namespace and might create confusion.Impact
The impact should be minimal. The behaviour will only change when the developer decides to use a custom namespace in their app/package. Maintenance impact should also be minimal.
I would like to implement this myself, if suitable, @danharrin
Beta Was this translation helpful? Give feedback.
All reactions