kirschbaum-development/
eloquent-power-joins
g4t.io

Laravel Eloquent Power Joins Package

19 views 1,573 stars by Luis Dalmolin

The Laravel magic applied to joins.

README from kirschbaum-development/eloquent-power-joins Open on GitHub →

Eloquent Power Joins

The Laravel magic you know, now applied to joins

Laravel Supported Versions run-tests MIT Licensed Latest Version on Packagist Total Downloads

Eloquent is very powerful, but it lacks a bit of the "Laravel way" when using joins. This package lets you write joins the Laravel way: more readable, with less code, and without leaking implementation details where they don't belong.

Instead of writing joins by hand:

User::select('users.*')
    ->join('posts', 'posts.user_id', '=', 'users.id')
    ->join('comments', 'comments.post_id', '=', 'posts.id');

You can use the relationships you've already defined:

User::joinRelationship('posts.comments');

Polymorphic relationships, soft deletes, model scopes, aliases and extra relationship conditions are all handled for you. You can also query relationship existence using joins and sort results by columns or aggregations from related tables:

// Query relationship existence using joins instead of where exists
User::powerJoinHas('posts');

// Order by a related column
User::orderByPowerJoins('profile.city');

// Order by an aggregation on a related table
Post::orderByPowerJoinsCount('comments.id', 'desc');

Documentation

You'll find the full documentation on our documentation site.

You can also read a more detailed explanation of the problems this package solves in this blog post.

Installation

You can install the package via composer:

composer require kirschbaum-development/eloquent-power-joins

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@kirschbaumdevelopment.com instead of using the issue tracker.

Credits

Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more about us or join us!

License

The MIT License (MIT). Please see License File for more information.

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News