Home > database >  Create a folder inside the component folder laravel
Create a folder inside the component folder laravel

Time:12-06

I have a project that will contain a lot of components, however I want to divide the folder of components into section as you can see:

Screenshot folders

However when I use the component inside the test folder I'm getting an error:

View [components.admin-panel-main-navbar] not found

How can I fix this issue?

CodePudding user response:

You may use the . character to indicate if a component is nested deeper inside the components directory. For example, assuming the component is defined at resources/views/components/inputs/button.blade.php, you may render it like so:

<x-inputs.button/>

https://laravel.com/docs/8.x/blade#anonymous-components

So in your case

<x-test.admin-panel-main-navbar/>
  • Related