justbetter / laravel-pagination-with-havings Goto Github PK
View Code? Open in Web Editor NEWMakes it possible to use pagination with havings in queries with Laravel.
License: MIT License
Makes it possible to use pagination with havings in queries with Laravel.
License: MIT License
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out
My internet connection is ok.
When I install an error like this appears:
Problem 1 - Installation request for justbetter/laravel-pagination-with-havings ^1.0 -> satisfiable by justbetter/laravel-pagination-with-havings[1.0]. - Conclusion: remove laravel/framework v5.8.2 - Conclusion: don't install laravel/framework v5.8.2 - justbetter/laravel-pagination-with-havings 1.0 requires laravel/framework ~5.5.0|~5.6.0|~5.7.0 -> satisfiable by laravel/framework[5.5.x-dev, 5.6.x-dev, 5.7.x-dev]. - Can only install one of: laravel/framework[5.5.x-dev, v5.8.2]. - Can only install one of: laravel/framework[5.6.x-dev, v5.8.2]. - Can only install one of: laravel/framework[5.7.x-dev, v5.8.2]. - Installation request for laravel/framework (locked at v5.8.2, required as 5.8.*) -> satisfiable by laravel/framework[v5.8.2]
Hi,
Thanks for this awesome package. It works great however there is a conflict with another package that I am using.
https://github.com/jarektkaczyk/eloquence
When I add trait I get the following error.
Trait method newBaseQueryBuilder has not been applied, because there are collisions with other trait methods
The following method fixes the problem but in that case, I cant use Sofa/Eloquence
use PaginationWithHavings,Eloquence{
PaginationWithHavings::newBaseQueryBuilder insteadof Eloquence;
}
Any idea how to fix it?
I have install the package, and loaded in model
latitude;){ $longitude =$request->longitude; $doctors = DB::table("directories"); $doctors = $doctors->select("*", DB::raw("3959* acos(cos(radians(" . $latitude . ")) * cos(radians(latitude)) * cos(radians(longitude) - radians(" . $longitude . ")) + sin(radians(" .$latitude. ")) * sin(radians(latitude))) AS distance")); $doctors = $doctors->having('distance', '<', 100); $doctors = $doctors->orderBy('distance', 'asc'); $doctors =$doctors->paginate(100); } but i still have the same error, Laravle 5.7 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'having clause' (SQL: select count(*) as aggregate from `directories` having `distance` < 100) -- ยHello!
Laravel 5.8
In this case it does not work.
pays its a hasManyThrough relation.
$orders->withCount(['pays as pay_sum' => function (Builder $q) {
return $q->select(DB::raw('SUM(invoice_pays.sum)'));
}])->havingRaw('pay_sum >= `orders`.`amount`');
Column not found: 1054 Unknown column 'orders.amount' in 'having clause'
But of course such a column exists. Everything works well without pagination.
Could we please make the updates needed to support Laravel 8.0?
Thanks for the package ๐
this package don't support laravel 6.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.