binshops / laravel-blog

Laravel Blog Package/ Laravel CMS. Easiest way to add a blogging system to your Laravel website. Laravel Blog.

Home Page:https://www.binshops.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trying to get property 'locale' of non-object

hasnainali9 opened this issue · comments

namespace BinshopsBlog\Middleware;

use Closure;

use BinshopsBlog\Models\BinshopsConfiguration;

use BinshopsBlog\Models\BinshopsLanguage;

class LoadLanguage

{

public function handle($request, Closure $next)

{

    $default_locale = BinshopsConfiguration::get('DEFAULT_LANGUAGE_LOCALE');

    $lang = BinshopsLanguage::where('locale', $default_locale)

        ->first();



    $request->attributes->add([

        **'locale' => $lang->locale,**

        'language_id' => $lang->id

    ]);



    return $next($request);

}

}

Hi,
it seems that you have not set up the package.
thanks