eloquent query from variable code example Example: laravel get sql query eloquent with parameters $query->toSql(); $query->getBindings()