Personal Plugin v3 Upgrade not showing up
I have a personal blog plugin for filament, here is my service provider. From the documentation it looks like we can still use spatie package tools here is my service provider
From what I can see its not registering the routes so may not be running the service provider ?
45 Replies
did you check the skeleton
https://github.com/filamentphp/plugin-skeleton
GitHub
GitHub - filamentphp/plugin-skeleton: A package skeleton for develo...
A package skeleton for developing Filament plugins. - GitHub - filamentphp/plugin-skeleton: A package skeleton for developing Filament plugins.
ok Ill modify my service provider like the skeleton one how would I convert
To the new syntax
the publish is fine it's the same as the
spatie/laravel-package-tools
nothing in that has changedwhat would cause the routes to work?
make sure the service provider is in the composer autoload
is it in the
artisan route:list
?
any errors other than 404?
make sure you register the routes as explained in spatie/laravel-package-toolsroute:list is not showing the added routes
is what i am using in the configurePackage
what in your web.php?
it works fine in 2.x just not 3.x
if you if you can share the ServiceProvider
do you have
in your composer?
And the files for building the package are located in /packages/filement-blog
can you access the resources in /admin?
resource does not show up
its almost like its not loading at all
did you add the plugin to your adminPanelProvider?
did you create the plugin class?
https://github.com/filamentphp/plugin-skeleton/blob/3.x/src/SkeletonPlugin.php
GitHub
plugin-skeleton/src/SkeletonPlugin.php at 3.x Ā· filamentphp/plugin-...
A package skeleton for developing Filament plugins. - filamentphp/plugin-skeleton
then you would add the plugin to :
for the resources to show up in the admin, you gonna need a pluginClass
and register it in the admin panel provider
but the route issue I am not sure, it should be registered since you have a serviceProvider auto loaded
so blogPlugin should look something like this
did you require the package to the composer of the main app you testing??
"Illusive/blog": "...",
š I dont have any other solutions to think ofyes
composer update?
how do you add the plugin to the adminserviceprovider
I think that might be the step I am missing
AdminPanelProvider*
this is the way
the AdminPanelProvider is in your testing app
yes
BlogPlugin::make()
nice catch š
ok making headway we got errors now, I am guessing Form changed in v3
yup
What imports are you using?
Do you see the resource now in the menu?
one sec updating the imports
I guess you missing an import
I've never seen
Filament\Resources\Form
classesfrom v2
Maybe
Filament\Forms\Form
now?yup
so the form methods should not be static it looks like either
Good to remember that the standard method to register a plugin is:
new BlogPlugin()
With the make function you added you need to do BlogPlugin::make()
That is why it didn't workMy plugin form is this:
public static function form(Form $form): Form
ahhh nm its the same issue bad import
now you have to follow the upgrade
https://filamentphp.com/docs/3.x/panels/upgrade-guide
Yeah i guess replace most of the
Resources
to Forms
there is many method signature changed
awesome thank you both, i think it got it all working now
Great, good luck!
congrats