Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Backpack: Namespace views not working #106

Open
jer3m01 opened this issue Feb 26, 2019 · 2 comments
Open

Laravel Backpack: Namespace views not working #106

jer3m01 opened this issue Feb 26, 2019 · 2 comments
Assignees

Comments

@jer3m01
Copy link

jer3m01 commented Feb 26, 2019

When including a blade file using @include the path is not resolved using the theme's directory and defaults to /vendor/.

For example I have the following views:

resources
└──themes
   └──AdminLTE2
      ├──base
      |  └──index.blade.php
      └──vendor
         └──backpack
            └──base
               └──layout.blade.php

Inside of index.blade.php , @include('backpack::layout') should resolve as \resources\themes\AdminLTE2\vendor\backpack\base\layout.blade.php
but instead (if assume) tries resources\views\vendor\backpack\base\layout.blade.php but defaults to\vendor\backpack\base\src\resources\views\layout.blade.php as it cannot find the views.

EDIT: forgot to put \views\

@igaster igaster self-assigned this Feb 27, 2019
@igaster
Copy link
Owner

igaster commented Feb 27, 2019

Hello @jer3m01,

This is confusing...

I am checking the laravel docs: https://laravel.com/docs/5.7/packages > 'Overriding Package Views' and it mentions: "Laravel actually registers two locations for your views: the application's resources/views/vendor directory and the directory you specify"

I believe that this line backpack Service provider is creating some conflicts because the same path (minus one level) is already included by Laravel under the same namespace.

I need to install a backpack and investigate this in depth...

@igaster igaster changed the title Namespaced blade views not working with @include Backpack: Namespaced blade views not working with @include Oct 11, 2019
@igaster igaster changed the title Backpack: Namespaced blade views not working with @include Laravel Backpack: Namespace views not working Oct 11, 2019
@pepoteloko
Copy link

pepoteloko commented Nov 21, 2022

It seems that we have the same problem but it only happens to team developers using windows.
It works on OSX and on Linux.
Maybe it's a folder separator problem?
After reading again: We don't use backpack, but the problem is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants