Answer the question
In order to leave comments, you need to log in
How to install Eloquent?
Help me install and attach Eloquent ORM to your project outside of Laravel (Yes, it is outside of Laravel)
I don’t really understand composer, and there is no installation code in the github repository , in short - a problem :(
Answer the question
In order to leave comments, you need to log in
there is no code to install, in short - a problem :(
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]);
// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
$capsule->setEventDispatcher(new Dispatcher(new Container));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
require 'vendor/autoload.php';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question