I know that the syntax is wrong but i want an condition inside sql query that if has payment_invoices.total_cost then the sum wil be sum(payment_invoices.total_cost) else the sum will be sum('services.cost')
i want the total sum that query but with excact that filter
@Sabonzy
I tried something like that but maybe must export only one Sum of that
something like that sum(services.cost,payment_invoices.total_cost) as total_credits
Because i try it and i get error :
htmlspecialchars() expects parameter 1 to be string, object given (View: C:\laragon\www\projects\laravel\crm\resources\views\livewire\services\showall.blade.php)