Database highlighting error not found

In the controller, when I tried to call a function from the model, it throws an exception

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)

Class 'Illuminate\Database\Eloquent' not found

the controller is simple and I used to create a namespace to manage the subdirectory and model controllers

<?php
namespace Manage ;
use Illuminate\Support\Facades\View;
use Illuminate\Routing\Controller;
class BaseController extends Controller {

    /**
     * Setup the layout used by the controller.
     *
     * @return void
     */
                    protected $layout = 'manage.layouts.master';
    protected function setupLayout()
    {
        if ( ! is_null($this->layout))
        {
            $this->layout = View::make($this->layout)->with(Dashboard::all());
        }
    }

}

and model

<?php
namespace Manage ;
use Illuminate\Database\Eloquent;
class Dashboard extends Eloquent{
    protected $table = 'admin_dashboard_sidebar';
    //put your code here
}
+4
source share
1 answer

Model Class:

use Illuminate\Database\Eloquent\Model as Eloquent;

or simply

use Eloquent;

This last one is an alias of the class that you can find in yours app/config/app.php.

+13
source

All Articles