public function __construct(){ parent::construct(); $this->capsule = new Capsule; $this->capsule->addConnection([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'phptest', 'username' => 'root', 'password' => 'simplonco', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '' ]); $this->capsule->setEventDispatcher(new Dispatcher(new Container)); $this->capsule->setAsGlobal(); $this->capsule->bootEloquent(); $this->users = Capsule::table('Users'); $this->questions = Capsule::table('Questions'); $this->reponses = Capsule::table('Reponses'); }