Aprod
Aprod
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
@krekas this is some aggregated data, I have event with days with meals with recipes with ingredients, and I need a list where all the ingredients are listed that are required for an event, and also the amount of the ingredient summed up. Yes, we could do a solution to eagerload and then calculate in PHP these sums, but that way you cannot order by the sums, so the sum needs to be in the query. Anyways if I remove the $join and only create an addSelect it is still not working, so that is why I simplied it down to be more understandable
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
Right now it works with the select but then I loses features such as groups on table
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
This is my whole query, I just simplied it down to be more understandable
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
the query method first parameter can be a clouser that returns a query
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
v3
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
I added HasTable and InteractsWithTable
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
This is a simple livewire component
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
This has no parent::getEloquentQuery
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
This is a table
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
but this would be the meaning of addSelect to not overwrite current selects just add a new one
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
If I add all the fields that I'm using it is working
return Ingredient::query()
->select([
'id',
DB::raw('total * price as total_price'),
'name',
'totals.total as total',
'price'
]);
return Ingredient::query()
->select([
'id',
DB::raw('total * price as total_price'),
'name',
'totals.total as total',
'price'
]);
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
This is my query
return Ingredient::query()
->addSelect([DB::raw('total * price as total_price')]);
return Ingredient::query()
->addSelect([DB::raw('total * price as total_price')]);
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
I think the problem is thet when I add addSelect to the query, it overwrites the default selects
29 replies
FFilament
Created by Aprod on 8/24/2023 in #❓┊help
addSelect is not working on $table->query()
29 replies