Comments (9)
Hi there, I believe I found the issue. In vendor\hyn\multi-tenant\src\Providers\TenancyProvider.php
you can see the code:
protected function registerProviders()
{
$this->app->register(Providers\ConfigurationProvider::class);
$this->app->register(Providers\PasswordProvider::class);
$this->app->register(Providers\ConnectionProvider::class);
$this->app->register(Providers\UuidProvider::class);
$this->app->register(Providers\BusProvider::class);
$this->app->register(Providers\FilesystemProvider::class);
$this->app->register(Providers\HostnameProvider::class);
$this->app->register(Providers\DatabaseDriverProvider::class);
$this->app->register(Providers\QueueProvider::class);
// Register last.
$this->app->register(Providers\EventProvider::class);
$this->app->register(Providers\RouteProvider::class);
}
When messing around trying to figure out the pipeline issue I added:
protected function registerProviders()
{
. . .
$this->app->register(\Igaster\LaravelTheme\themeServiceProvider::class);
}
And the theme actually loads, I was thinking I should maybe bind hyn/tenancy's provider and just load your provider after. but I wasn't sure and wanted your opinion on it. As always I have greatly appreciated your patience.
from laravel-theme.
The config didn't seem to effect it, but we somewhat have a solution for it that just isn't pretty. If I find anything else out I'll let you know. Thank you so much for the help!
from laravel-theme.
Hello @robertdrakedennis, this package is bootstrapped within ThemeServiceProvided which is being auto-discovered by Laravel. Thus there is no guarantee that you can interact with themes from any other Service Provider. A middleware is a safe place to use the themes.
However the in error stack that you shared I can't see the ThemeViewFinder being loaded (stack steps 79+80). Is it possible that the package is not loaded correctly? Try to resolve the Views Finder from the IoC inside your controller action: dd(app("view.finder"))
. Is this an instance of \Igaster\LaravelTheme\themeViewFinder?
from laravel-theme.
First of all, thank you immensely for the quick response.
When I dump the IoC inside my controller right before the view is being called this is the entire output:
https://hastebin.com/jutijukoxi.php
That being said as you can see it is the theme view finder. I'll also go ahead and dump anything else you might find useful, please let me know if you need anything else.
Config (igaster/laravel-theme):
https://hastebin.com/jebowolesa.xml
Composer.json:
https://hastebin.com/ivofehiroq.bash
Config (hyn/tenancy):
https://hastebin.com/dubosovagi.xml
from laravel-theme.
The main issue is I have no idea why themeViewFinder isn't in the error stack, but it's clearly being called through the pipeline, I've only experienced this issue the moment I started using hyn/tenancy
from laravel-theme.
a) So you haven't set some theme and it will pick the "default" theme.
Is this the intented behaviour? (check switching themes for instructions about setting current theme)
These are the paths where your views will be looked up:
#paths: array:2 [▼
0 => "/var/www/odin/resources/themes/default"
1 => "/var/www/odin/resources/views"
]
b) In order to render a view from your theme you must define it a relative inside the theme folder...
ie view('aaa.bbb')
will be resolved from /var/www/odin/resources/themes/default/aaa/bbb.blade.php
Can you verify that the view that you are trying to render exists in your current theme path?
from laravel-theme.
Yes currently in my env I have the theme set as "default" as I don't have any other themes done right now.
https://i.imgur.com/wJBch3z.jpg
my env: https://hastebin.com/zaxusuqeka.ini
You can view here that there in indeed the view exists in the current theme path. If you need any other info from me please let me know.
from laravel-theme.
It seems fine... the login view should be picked from the theme path... Did you check the actual view path (ie with debug bar) and it is the default laravel view?
Also can you verify that the view search paths have not manipulated by some other part of the application (ie multitenant middleware?). Try to dump the viewfinder (dd(app("view.finder"))
) just before you render the view (ie in your controller action). Are these correct?
from laravel-theme.
Hello @robertdrakedennis, if you wish to edit a package code then you must fork it and use your own version as a dependency. Not the best dev experience IMO!
I was checking this package and it allows the view paths to be moved into tenant directories... Maybe this is the reason that themes are not working. You can a) try to load themeServiceProvider after the TendantcyServiceProvider b) Disable this feature from config\tentant.php
(check https://github.com/tenancy/multi-tenant/blob/5.x/assets/configs/tenancy.php#L391)
Let me know if this helps!
from laravel-theme.
Related Issues (20)
- Lumen ? HOT 2
- Add support for Laravel 6.0 HOT 2
- mkdir(): No such file or directory HOT 1
- @js() doesnt accept http/https HOT 1
- Theming email template HOT 1
- Support for array dot
- Check, if cache file exists instead of having config value
- Timeline for laravel 7 support? HOT 1
- Anyone get this working with view composers for each theme? (overlapping view names) HOT 2
- View file path issue when loading from Namespace HOT 2
- Included files not rendering after upgrade HOT 2
- vendor views are not rendering with https://github.com/Okipa/laravel-table/ HOT 1
- Markdown not looking in right directories
- Package is not compatible with laravel 9 HOT 1
- Has this package been tested with any newer versions of Laravel?
- the directory separator is not correct for Windows.
- Allowed to keep the view paths added at runtime after setting theme
- Incompatible with Laravel 10 HOT 2
- Deprecation Warnings on PHP 8.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-theme.