You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
Yes, it's still reproducable
What version of Laravel Excel are you using?
3.1.55
What version of Laravel are you using?
v10.48.7
What version of PHP are you using?
8.3.7
Describe your issue
I wrote a class implementing FromQuery and With Headings to use Exportable.
I used the __constructor to pass a Query from outside, which I am referencing in the query method.
This is working fine. At the moment, when I add a join to the query method, it adds it twice.
If I am not passing the query over the constructor, it's working. If I am adding the joins outside and than pass it its also working.
Call of the class $query = Review::query(); return (new ExcelReviewExport($query))->download('reviews.xlsx');
`class ExcelReviewExport implements FromQuery, WithHeadings
{
use Exportable;
public $query;
public function __construct($query)
{
$this->query = $query;
}
public function query(){
return $this->query
->select(['id'])
->join("products", "reviews.product_id", '=', "products.id");
}`
This is not stated in the documentation and maybe was never supposed to be used like this, but it would be nice if it worked. I will add the joins as a workaround outside of the class, so this is really low prior for me.
Thanks for the great work on this Package!
How can the issue be reproduced?
Create an ExcelExport Class with FromQuery.
Pass the query over to the constructor.
Add a join in the query method to the passed query.
What should be the expected behaviour?
Adding joins only once.
The text was updated successfully, but these errors were encountered:
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
What version of Laravel Excel are you using?
3.1.55
What version of Laravel are you using?
v10.48.7
What version of PHP are you using?
8.3.7
Describe your issue
I wrote a class implementing FromQuery and With Headings to use Exportable.
I used the __constructor to pass a Query from outside, which I am referencing in the query method.
This is working fine. At the moment, when I add a join to the query method, it adds it twice.
If I am not passing the query over the constructor, it's working. If I am adding the joins outside and than pass it its also working.
Call of the class
$query = Review::query(); return (new ExcelReviewExport($query))->download('reviews.xlsx');
`class ExcelReviewExport implements FromQuery, WithHeadings
{
use Exportable;
This is not stated in the documentation and maybe was never supposed to be used like this, but it would be nice if it worked. I will add the joins as a workaround outside of the class, so this is really low prior for me.
Thanks for the great work on this Package!
How can the issue be reproduced?
Create an ExcelExport Class with FromQuery.
Pass the query over to the constructor.
Add a join in the query method to the passed query.
What should be the expected behaviour?
Adding joins only once.
The text was updated successfully, but these errors were encountered: