Skip to content
New issue

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

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

Already on GitHub? # to your account

Call to a member function has() on null #86

Closed
karneaud opened this issue Sep 30, 2019 · 1 comment
Closed

Call to a member function has() on null #86

karneaud opened this issue Sep 30, 2019 · 1 comment

Comments

@karneaud
Copy link

I am using both the modules and themes(v5.2.0 & v6.1.0 ) packages with Laravel 5.8.* on PHP 7.1
I have the modules in app/Modules while themes are in public/themes

my providers are registered/ discovered and in a middleware i have the following

if (!auth()->user()->hasRole("admin")) {
            Theme::set('angostura');
         }

when i try to visit a route with the middleware I encounter

Call to a member function has() on null

which points to

protected function resolveTheme($theme)
    {    
        $theme  = $this->where('slug', $theme)->first();
        $parent = null;
        if ($theme->has('parent')) {
            $parent = $this->where('slug', $theme->get('parent'))->first();
        }

which seems to return $theme as null even though the theme is active

any idea what is causing this?

@taufiqtab
Copy link

taufiqtab commented Oct 29, 2022

i get the same issue with laravel 5.8 php 7.2, can you share how you solve this problem ?

edit :

running composer update to fixed it

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

No branches or pull requests

2 participants