mDelshad
6 months ago
94
12
Laravel

Call to a member function connection() on null

Posted 6 months ago by mDelshad

i'm create a helper to get settings

if (! function_exists('Setting')) {

    /**
     * @param $setting
     *
     * @return string
     */
    function Setting($setting)
    {
        return Setting::where('name',$setting)->first()->val;
    }


}

in config/app.php and Application name i'm set this code Setting('app_name')

but this error displayed

Call to a member function connection() on null

Please sign in or create an account to participate in this conversation.