This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Shahiem
Shahiem

Hi, I have a problem with my plugin. I get an error when I use the Settings Model in my Routes.php file. How can I solve this problem?

Thank you :)


 if(Settings::get('maintenace') == TRUE)
    {
            echo 'test';
    }

Error: Call to a member function connection() on a non-object


Call to a member function connection() on a non-object
open: C:\wamp\www\cms\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php
     * Resolve a connection instance.
     *
     * @param  string  $connection
     * @return \Illuminate\Database\Connection
     */
    public static function resolveConnection($connection = null)
    {
        return static::$resolver->connection($connection);
    }
deadcrowwalking
deadcrowwalking

If you did copy&paste and this is what you actually have, then I guess it's a typo in Settings::get('maintenace') and maintenace should be maintenance.

Otherwise I have no clue either. ;)

Last updated

Shahiem
Shahiem

True, that's right, I changed it to maintenance. And the solution of my problem:

App::before(function($request) {

 if(Settings::get('maintenance') == TRUE)
{
 }

});

Last updated

deadcrowwalking

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.