PHP code example of northern-lights / eloquent-bootstrap

1. Go to this page and download the library: Download northern-lights/eloquent-bootstrap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

northern-lights / eloquent-bootstrap example snippets

 php


declare(strict_types=1);

namespace NorthernLights\EloquentBootstrap\Example;

use NorthernLights\EloquentBootstrap\Database;
use NorthernLights\EloquentBootstrap\Provider\ConfigOptions;
use NorthernLights\EloquentBootstrap\Provider\ConfigProvider;

uent will boot
$database->init();
 php


(...)
// Notice that you need this line too
$database->getCapsule()->setAsGlobal();

$user = DB::table('users')->where('userid', '=', '123');

dump($user);
 php


declare(strict_types=1);

namespace NorthernLights\EloquentBootstrap\Example;

use NorthernLights\EloquentBootstrap\Model as EloquentModel;

/**
 * Class Users
 * @package NorthernLights\EloquentBootstrap\Example
 */
class Users extends EloquentModel
{
    /** @var string  */
    protected $table = 'users';
}