Skip to content

Instantly share code, notes, and snippets.

@azazqadir
Created November 15, 2017 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azazqadir/d48218490288686b940412327b1ceb8e to your computer and use it in GitHub Desktop.
Save azazqadir/d48218490288686b940412327b1ceb8e to your computer and use it in GitHub Desktop.
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