Filament resource not showing on website
i made a migration, model and now a resource i followed a tutorial to see how i can make a resource i did everything like the video but i just don't see the resource on my website
Solution:Jump to solution
If you want the resource for your org panel, you should create it for org and not third party
50 Replies
this is my code now
- can you access it by url directly?
- check
artisan route:list
- do you have policies for the model?
- change the slug!im kinda new to filament and laravel and this was a already existing project of my boss how do i know if i can acces the url directly? and what should i see in the route:list because its really long, what is policies for the model? and why change the slug? (sorry for all the questions)
No offence but it looks like you need to familiarise yourself with Laravel first and then look into the rest
ah oke yeah i did some research but not enough i see, do you have some websites that you recommend?
i am just trying to let this work so i can just try out a bit but i cant see it here
🙂
ok so I do agree with @ChesterS
either way
this will help you with the routes to see it in the browser and search, you should see the same class
https://github.com/garygreen/pretty-routes
policies is laravel thing https://laravel.com/docs/11.x/authorization#creating-policies
the doc is the best resource 🙂
Ha, you were faster 😄
oke thanks a lot i will look into those websites 😄 the github has the anwser and the laravel is just to get to know it a bit better right?
the package
pretty-routes
is just to help you see the routes 🙂thats easier then route:list?
Untill you're confident with the basic stuff, I would suggest you have a look at a page that works and see how it's different from the one that doesn't. Follow Zeus' instructions, see if the URL you're trying to access appears in the list from
route:list
command
You'll get there! Good luck 👍thanks 😄
i just looked at the route:list and i don't see the shipmentItemResource that needs to be shown so i think thats the problem
now i know where the problem is. the thing is now that i need to find how to fix it
you guys completly opened my eyes i now see some things that where missing in my migration so lets hope that those things will fix it
@ChesterS sorry for the tagg but i had a quick question, i have done some digging but i can't really seem to find information on how to add things to the route:list. Like what do i need to do to add my resource to the roue:list
If everything is set up correctly, you don't need to do anything. Resources are added automatically
hmm oke then there should be something wrong in my migration or model right?
Migrations and models shouldn't really affect the routes. Follow filaments documentation and you should at least be able to see the routes
Whether they work correctly (or if you have access to them) is a different issue. Do you have more than one panels?
yes i do have more then one panel
You probably don't have auto disovery for Resources in subfolders:
App\Filament\ThirdParty\Resources
they all seem to work and show up but i can't really find the difference between the not working one and the working one
Is this the only Resource in the
ThirdParty
subfolder?
You need to add it to the Panel via ->discoverResources
i can't seem to find a ThirdParty folder in my resources
this is my resource folder
and the green folder and scripts are the ones that i am trying to make them work
will, from your code here
the namespace is
namespace App\Filament\ThirdParty\Resources;
so where is the ThirdParty
? 🙂The your namespace is wrong. It doesn't follow PSR-4
huh whut its just gone
if i delete the \Thirdparty in the files i get errors like this one
I recommend you take a step back and take a break and breath maybe a coffee or tea! what do you like?! 😂
then when you come back make sure you removed all
Thirdparty
from other files too 🙂Is it an actual error or just intelephense that isn't updated yet?
Maybe just start over with that resource. Save your files, create a new resource, check that it shows up and copy over your changes.
oke i will try this
its a actual error my intelephense is up to date
but i will try to make a new resource and ill come back to you if it worked or not 😄
just to make sure im doing it completly right this time thirdParty right?
Oh Third Party is the panel? Didn't realize that
As long as it really creates the folder, that's okay. Just make sure the folder exists. Otherwise manually move it there.
this is it right now
Looks better. Does it show up in your Third party panel?
no i don't see it on my website or isn't that what you meant?
"On my website" is pretty broad.
You are viewing the "third party" panel, right?
doesn't show here
What's the URL of the page you are on?
http://127.0.0.1:8000/org/9bac32ea-cb5e-4648-99f0-78b380c5f58a
its locally hosted so i don't know if you can see it
i don't know if you can see itNope. That would be pretty bad 😉
🤣 true
I assume
/org
belongs to the "org" panel. But you just created the resource for "third party"?!yes
So why should it show up for org?
Solution
If you want the resource for your org panel, you should create it for org and not third party
Every panel has it's own url via that it's accessed.
oh waauww yeah now it makes sence i did it trough org and it put the files in the right place without me moving it
only 1 thing i made the resource but my app, filament and resources folder turned red like its a error but no folder or script has a error
but everything works so ill just ignore it 🤣
@Dennis Koch i can't thank you enough for your patience and your great help ❤️ thank you thank you
and also big thanks to Lara and Chester you where also a big help for me
I guess that's the highlighting for version control in VSC 😉
ye i guess so 🙂
but it shows on my panel now onto the next problem 🤣