Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

mapyo/eloqunet-only

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use only eloquent in laravel

Installation

composer require mapyo/eloquent-only

Usage

<?php
use Mapyo\EloquentOnly\Eloquent;
$loader = require('./vendor/autoload.php');

Eloquent::init(
    array(
        'driver'   => 'mysql',
        'host'     => '127.0.0.1',
        'database' => 'database',
        'username' => 'user',
        'password' => 'password',
        'port'     => 3306,
        'collation' => 'utf8_unicode_ci',
        'charset'  => 'utf8',
    )
);

class User extends Illuminate\Database\Eloquent\Model
{
    protected $table = 'users';
}

$user = User::find(1);
var_dump($user->name);

$log = Eloquent::getConnection()->getQueryLog();
var_dump($log);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages