Use Eloquent Illuminate In PHP Without Laravel

Submitted by azazqadir - 4 weeks ago

Ask Laravel enthusiasts and they will tell you that Laravel Eloquent is one of the best parts of the framework. Have you ever thought of using it without installing the entire Laravel framework? I will create a small ACL using Laravel Eloquent. 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();

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks