Im follow phpacademys new authentication tutorial https://www.youtube.com/watch?v=PF2WkRCZfBg
i have a class file database.php:
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->addConnection([
'driver' => $app->config->get('db.driver'),
'host' => $app->config->get('db.host'),
'database' => $app->config->get('db.name'),
'username' => $app->config->get('db.username'),
'password' => $app->config->get('db.password'),
'charset' => $app->config->get('db.charset'),
'collation' => $app->config->get('db.collation'),
'prefix' => $app->config->get('db.prefix')
]);
$capsule->bootEloquent();
however it throws up this error:
Fatal error: Class 'Illuminate\Database\Capsule\Manager' not found in C:\xampp\htdocs\boilerplate\app\database.php on line 4
i have required it in start.php
<?php
require 'database.php';
//############ NAMESPACING ################//
use Slim\Slim; //import slim
use Noodlehaus\Config;
use Boilerplate\User\User;
//#########################################//
session_cache_limiter(false);
session_start();
ini_set('display_errors','on'); //TURN OFF ON LIVE SITE
define('INC_ROOT', dirname(__DIR__)); //create local root
require INC_ROOT . '/vendor/autoload.php'; // autoload in all the dependencies in the vendor files.
$app = new Slim([
'mode' => file_get_contents(INC_ROOT . '/mode.php')
]); //assign the entire app file to a variable
$app->configureMode($app->config('mode'), function() use ($app){
$app->config = Config::load(INC_ROOT . "/app/config/{$app->mode}.php"); //pull in the config file
});
$app->container->set('user', function(){
return new User;
});