How to install Eloquent?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
8 views
Help to install and fasten the Eloquent ORM in Laravel outside (Yes outside larabel)
In composer are not particularly understand, and in a repository on github there is no code to install, in short - the problem :(
by | 8 views

1 Answer

0 like 0 dislike
no code to install, in short - the problem :(


composer require illuminate/database

Well, the config in the readme lies
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 is a', '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();


and of course not to forget the composer to connect the first
require 'vendor/autoload.php';
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,535 users