PHPackages                             llama-laravel/eloquent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. llama-laravel/eloquent

ActiveLibrary[Database &amp; ORM](/categories/database)

llama-laravel/eloquent
======================

Extends Laravel Eloquent ORM.

2931PHP

Since Jan 3Pushed 9y ago2 watchersCompare

[ Source](https://github.com/xuanhoa88/laravel-eloquent)[ Packagist](https://packagist.org/packages/llama-laravel/eloquent)[ RSS](/packages/llama-laravel-eloquent/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Eloquent Joins
==============

[](#eloquent-joins)

[![StyleCI](https://camo.githubusercontent.com/492fa3e1657cd20df2051a5fce75583ac75dc9096abbf6cc9fa40820cd7e6b4b/68747470733a2f2f7374796c6563692e696f2f7265706f732f37373730333435302f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/77703450)[![Build Status](https://camo.githubusercontent.com/2f2e797c37edc3ef55544df4744dcef17102915138d35130a4644dd4f1a80031/68747470733a2f2f7472617669732d63692e6f72672f7875616e686f6138382f6c61726176656c2d656c6f7175656e742e737667)](https://travis-ci.org/xuanhoa88/llama-laravel/eloquent)[![Total Downloads](https://camo.githubusercontent.com/85a022ca50c04a55409cfc885402ace3177520b1ef28b0be3246403e39ff038c/68747470733a2f2f706f7365722e707567782e6f72672f7875616e686f6138382f6c61726176656c2d656c6f7175656e742f642f746f74616c2e737667)](https://packagist.org/packages/xuanhoa88/llama-laravel/eloquent)[![Latest Stable Version](https://camo.githubusercontent.com/fad6deadbd36f785d971d480f3a189abc462321784ad09540aed437d69c893b5/68747470733a2f2f706f7365722e707567782e6f72672f7875616e686f6138382f6c61726176656c2d656c6f7175656e742f762f737461626c652e737667)](https://packagist.org/packages/xuanhoa88/llama-laravel/eloquent)[![Latest Unstable Version](https://camo.githubusercontent.com/585c58eda5b3d0d72c36804fc8133cb9d4df8270b9e95b0b1635450d270e4077/68747470733a2f2f706f7365722e707567782e6f72672f7875616e686f6138382f6c61726176656c2d656c6f7175656e742f762f756e737461626c652e737667)](https://packagist.org/packages/xuanhoa88/llama-laravel/eloquent)[![License](https://camo.githubusercontent.com/418da11f24305b80b6888d0dbaa6c8b139a6a9e99bdcc50ba75ce267d87c515b/68747470733a2f2f706f7365722e707567782e6f72672f7875616e686f6138382f6c61726176656c2d656c6f7175656e742f6c6963656e73652e737667)](https://packagist.org/packages/xuanhoa88/llama-laravel/eloquent)

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.

Installation
------------

[](#installation)

Eloquent Joins is installable [with Composer via Packagist](https://packagist.org/packages/xuanhoa88/llama-laravel/eloquent).

Usage
-----

[](#usage)

### Use trait

[](#use-trait)

Simply use Llama\\Database\\Eloquent\\ModelTrait in a model:

```
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).

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.).

### Licence

[](#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.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8601be70d0d3d5a02c55b5aca4b1ee0d762370b77b95bdb8bce9f6a68a7d0827?d=identicon)[xuanhoa88](/maintainers/xuanhoa88)

---

Top Contributors

[![xuanhoa88](https://avatars.githubusercontent.com/u/406820?v=4)](https://github.com/xuanhoa88 "xuanhoa88 (11 commits)")

### Embed Badge

![Health badge](/badges/llama-laravel-eloquent/health.svg)

```
[![Health](https://phpackages.com/badges/llama-laravel-eloquent/health.svg)](https://phpackages.com/packages/llama-laravel-eloquent)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
