Git Product home page Git Product logo

Comments (9)

robertdrakedennis avatar robertdrakedennis commented on August 27, 2024 1

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.

robertdrakedennis avatar robertdrakedennis commented on August 27, 2024 1

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.

igaster avatar igaster commented on August 27, 2024

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.

robertdrakedennis avatar robertdrakedennis commented on August 27, 2024

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.

robertdrakedennis avatar robertdrakedennis commented on August 27, 2024

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.

igaster avatar igaster commented on August 27, 2024

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.

robertdrakedennis avatar robertdrakedennis commented on August 27, 2024

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.

igaster avatar igaster commented on August 27, 2024

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.

igaster avatar igaster commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.