Call to a member function connection() on null

Posted 3 years ago by ralphmrivera

Hi everyone,

I am facing a challenge that I'm not sure what to do with. I have a bunch of pages that work, but periodically I get this error:

Call to a member function connection() on null

The full error is below. When I mentioned "periodically" above, what I meant is that if I publish a page and repeatedly click the refresh button, the error below wth generate roughly 1 out of 20 times. I'm including my route and the complete blade below as well.

Any insight would be greatly appreciated.

Whoops, looks like something went wrong.

1/1
FatalErrorException in Model.php line 3245:
Call to a member function connection() on null
in Model.php line 3245
at FatalErrorException->__construct() in HandleExceptions.php line 133
at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at Model::resolveConnection() in Model.php line 3211
at Model->getConnection() in Model.php line 1914
at Model->newBaseQueryBuilder() in Model.php line 1857
at Model->newQueryWithoutScopes() in Model.php line 1831
at Model->newQuery() in IlluminateReminderRepository.php line 165
at IlluminateReminderRepository->removeExpired() in SentinelServiceProvider.php line 427
at SentinelServiceProvider->sweep() in SentinelServiceProvider.php line 413
at SentinelServiceProvider->garbageCollect() in SentinelServiceProvider.php line 47
at SentinelServiceProvider->boot() in Container.php line 503
at call_user_func_array:{/Users/Bespin/Projects/Ewok/vendor/laravel/framework/src/Illuminate/Container/Container.php:503}() in Container.php line 503
at Container->call() in Application.php line 734
at Application->bootProvider() in Application.php line 717
at Application->Illuminate\Foundation\{closure}() in Application.php line 718
at array_walk() in Application.php line 718
at Application->boot() in BootProviders.php line 17
at BootProviders->bootstrap() in Application.php line 203
at Application->bootstrapWith() in Kernel.php line 222
at Kernel->bootstrap() in Kernel.php line 117
at Kernel->sendRequestThroughRouter() in Kernel.php line 87
at Kernel->handle() in index.php line 54
at {main}() in index.php line 0

My route

Route::get('/', function () {
    return view('test');
});

The blade (test.blade.php)

<!DOCTYPE html>
<html>
<head>
    <title>TITLE</title>
</head>
<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <header class="main-header">
            {{-- Logo --}}
            <a href="#" class="logo">
                <span class="logo-mini">{!! Html::image('images/white.png', 'System', ['class' => 'img-responsive']) !!}</span>
                <span class="logo-lg">{!! Html::image('images/white.png', 'System', ['class' => 'img-responsive']) !!}</span>
            </a>
            <nav class="navbar navbar-static-top" role="navigation">
                {{--<!-- Sidebar toggle button-->--}}
                <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="navbar-custom-menu">

                </div>
            </nav>
        </header>

        {{--<!-- =============================================== -->--}}

        {{--<!-- Left side column. contains the sidebar -->--}}
        <aside class="main-sidebar">
            {{--<!-- sidebar: style can be found in sidebar.less -->--}}
            <section class="sidebar">
                {{--<!-- sidebar menu: : style can be found in sidebar.less -->--}}
                <ul class="sidebar-menu">
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                        <li><a href="#"><i class="fa fa-dashboard"></i> <span> Dashboard</span></a></li>
                </ul>
            </section>
            {{--<!-- /.sidebar -->--}}
        </aside>

        {{-- =============================================== --}}

        {{-- Content Wrapper. Contains page content --}}
        <div class="content-wrapper">
            {{-- Content Header (Page header) --}}
            <section class="content-header">
                <h1>
                    TEST
                </h1>
            </section>

            {{--<!-- Main content -->--}}
            <section class="content">
                Stuff
            </section>
            <div class="clearfix"></div>
            {{-- /.content --}}
        </div>
        {{-- /.content-wrapper --}}

        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version:</b> Beta 1.0.0
            </div>
        </footer>
    </div>
    {{-- ./wrapper --}}
</body>
</html>

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