igaster / laravel-theme

Theme support for Laravel
MIT License
516 stars 110 forks source link

Laravel Backpack: Namespace views not working #106

Open jer3m01 opened 5 years ago

jer3m01 commented 5 years ago

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 commented 5 years ago

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...

pepoteloko commented 1 year ago

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.