Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yxyx's avatar
Level 1

How to make a blade component anonymous?

Dear community,

I have recently started to learn Laravel. In the process, I've run into a problem with blade components that keeps coming up and I don't know how to fix it. Every time I created a blade component in Laravel with Artisan and want to make it anonymous afterwards, I get an error that the class for the component doesn't exist. The blade component is supposed to be anonymous and not have a component class. If I create an anonymous blade component without ever having created a blade component with the same name with Artisan before, everything works fine. It would be very nice if someone could help me!

Best regards yxyx

0 likes
3 replies
tykus's avatar
tykus
Best Answer
Level 104

and want to make it anonymous afterwards

Just run php artisan view:clear after deleting the Component class.

7 likes
yxyx's avatar
Level 1

Thank you very much, it works!

Please or to participate in this conversation.