-
I have a Blade component located at Modules/Auth/resources/views/admin/components/users/forms/user-form.blade.php. Because I've moved the components folder inside the admin folder, the following no longer works: <x-auth::admin.users.forms.user-form /> So I believe I have to use Blade::anonymousComponentNamespace() in the boot method of my AuthServiceProvider? I've tried many different combinations for the directory and prefix, but regardless the component is not found. Any ideas? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I would just use components/admin/users... |
Beta Was this translation helpful? Give feedback.
-
if you want to load components from none standard folders you will need to adjust in the service provider of the module: public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
$this->loadViewsFrom([$sourcePath], $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', '')));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
} |
Beta Was this translation helpful? Give feedback.
if you want to load components from none standard folders you will need to adjust in the service provider of the module: