28/05
2018
Wallogit.com
2017 © Pedro Peláez
Eloquent eager loading fix for parameter limits of SQLite and SQL Server
This Laravel Eloquent fix allows eager loading beyond the parameter limits of MySQL/MariaDB (65,535), PostgreSQL (65,535), SQLite (999), and SQL Server (2,100)., (*2)
Tested with Laravel 5.4+., (*3)
composer require staudenmeir/eloquent-param-limit-fix
Use the ParamLimitFix trait in the affected parent models:, (*4)
class User extends Model
{
use \Staudenmeir\EloquentParamLimitFix\ParamLimitFix;
public function posts()
{
return $this->hasMany('App\Post');
}
}
$users = User::with('posts')->get();
staudenmeir/laravel-adjacency-list: Replace both packages
with staudenmeir/eloquent-param-limit-fix-x-laravel-adjacency-list
to use them on the same model.Please see CONTRIBUTING and CODE OF CONDUCT for details., (*5)