Call to a member function has() on null
karneaud opened this issue · comments
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?
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