Skip to content

Instantly share code, notes, and snippets.

@pippinsmith
pippinsmith / Builder.php
Last active October 10, 2019 15:23
Eloquent Builder that allows for eager loading relationships with parameters
<?php
namespace App;
use BadMethodCallException;
use Closure;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\RelationNotFoundException;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Str;