2017 © Pedro Peláez
 

library eloquent

Extends Laravel Eloquent ORM.

image

cgi/eloquent

Extends Laravel Eloquent ORM.

  • Wednesday, January 17, 2018
  • by cgi
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,555 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

Eloquent Joins

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock, (*1)

This package allows you to simply call $model->join($relation) to join a Laravel Eloquent relationship's table on the keys declared by your relationship. Columns will be selected automatically, and the joined records hydrated as models in the resulting collection. Laravel's Eloquent does support joins normally, but internally calls the underlying query builder, thereby expecting the name of a table and keys to join it on as arguments., (*2)

Installation

Eloquent Joins is installable with Composer via Packagist., (*3)

Usage

Use trait

Simply use Llama\Database\Eloquent\ModelTrait in a model:, (*4)

namespace App;

use Llama\Database\Eloquent\ModelTrait;

class User
{
    use ModelTrait;

    protected $table = 'users';

    public function orders()
    {
        return $this->hasMany(\App\Order::class);
    }
}

$users = \App\User::join('orders')->get();

In the above example, $users will contain a collection of all the User models with a corresponding Order model (since we've performed an inner join). Each corresponding Order model can be found in the $orders property on the User model (normally this would contain a collection of models with a matching foreign key)., (*5)

You can string multiple join() calls, as well as use the other types of join normally available on the underlying query object (joinWhere(), leftJoin(), etc.)., (*6)

Licence

Eloquent Joins is free and gratis software licensed under the [MIT licence]. This allows you to use Eloquent Joins for commercial purposes, but any derivative works (adaptations to the code) must also be released under the same licence., (*7)

The Versions

17/01 2018

dev-master

9999999-dev https://github.com/cgi-cgi/laravel-eloquent

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen
by Avatar cgi

laravel eloquent cgi join llama

17/01 2018

5.5.x-dev

5.5.9999999.9999999-dev https://github.com/cgi-cgi/laravel-eloquent

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen
by Avatar cgi

laravel eloquent cgi join llama

12/09 2017

dev-mapper

dev-mapper https://github.com/cgi-cgi/laravel-eloquent

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen
by Avatar cgi

laravel eloquent cgi join llama

28/07 2017

5.4.x-dev

5.4.9999999.9999999-dev https://github.com/cgi-cgi/laravel-eloquent

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen
by Avatar cgi

laravel eloquent cgi join llama

07/05 2017

5.3.x-dev

5.3.9999999.9999999-dev

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen

laravel eloquent join llama

05/05 2017

dev-analysis-qyl0Nj

dev-analysis-qyl0Nj

Extends Laravel Eloquent ORM.

  Sources   Download

MIT

The Requires

 

The Development Requires

by XuaNguyen

laravel eloquent join llama