For some reason, I put my Laravel blade components inside the App/Core/CoreComponents folder, so now I can’t use these components like the old way:
<x-Core.CoreComponents.input />
And after searching I found a way by using this in AppServiceProvidor.php to make alias
// AppServiceProvidor.php in boot()
Blade::componentNamespace('CoreComponents', 'Core.CoreCoreComponents');
// use the components in blade.php
<x-CoreComponents::input />
but it does not work, so is there any way to do that?
and does it affect the performance? (note that I really want to put them inside App folder)
2
Answers
Follow the document at https://laravel.com/docs/master/blade#manually-registering-components, I think you have a typo:
instead of
And when register components namepsace, you have to use full namespace:
my web app does its job from the app/view. Anyways, I just read about the same topic on laravel docs: