Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Eloquent Outside of Laravel for Other PHP Apps. Source: https://www.cloudways.com/blog/eloquent-illuminate-in-php-without-laravel/
<?php
require "vendor/autoload.php";
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->addConnection([
   "driver" => "mysql",
   "host" =>"127.0.0.1",
   "database" => "acl",
   "username" => "root",
   "password" => ""
]);
$capsule->setAsGlobal();
$capsule->bootEloquent();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.