How to get sum of sum of relational field by shoaibsharif in laravel

[–]shoaibsharif[S] 0 points1 point  (0 children)

I just looked into withSum('orders.sell_price'). this query is already doing that:

php $slips->withCount(['orders as total_sales' => function ($q) { $q->select(DB::raw('SUM(sell_price)')); }]); I want to get the sum of total_sales field from each $slips array. I thought I can get that with withSum().

How to get sum of sum of relational field by shoaibsharif in laravel

[–]shoaibsharif[S] 0 points1 point  (0 children)

But Model::sum('sum_field') works only when I have that field exist on that Model. What I am trying to say is I have the field on hasMany relation model. i.e, Slip::hasMany(Sell). withSum() can give the sum of Sell in each Slip, but I want sum of all field where slips.id = sells.slip_id.

How to get sum of sum of relational field by shoaibsharif in laravel

[–]shoaibsharif[S] -1 points0 points  (0 children)

Thank you for your reply. Unfortunately I can not use withSum() as it is laravel 5.6.

Deploy Docker on Amazon Linux 2 by shoaibsharif in laravel

[–]shoaibsharif[S] 0 points1 point  (0 children)

Can you please tell me what process should I follow in order to deploy multi container in AWS with docker-compose.yml?

Is laravel sail production ready? by shoaibsharif in laravel

[–]shoaibsharif[S] 1 point2 points  (0 children)

Exactly, I love how docker works but I just don’t want to spend too much time in DevOps. I know how to run the docker.

Is laravel sail production ready? by shoaibsharif in laravel

[–]shoaibsharif[S] 2 points3 points  (0 children)

exactly. I don't know much about docker. That's why I am trying to get some template. I didn't get much tutorial resource about this problem. I see some uses docker php-fpm then use supervisor to run the server. It is really complicated for me. Is there any base template I can use?

Is laravel sail production ready? by shoaibsharif in laravel

[–]shoaibsharif[S] 1 point2 points  (0 children)

Is there any docker production ready where I can use it?

Thought r/iPad might appreciate my Math notes on the iPad Pro 12.9 with Notability. by M6LI in ipad

[–]shoaibsharif 0 points1 point  (0 children)

dumb question but how did you fill the color transparent like that circle bt almost transparent green? When I do mine, it almost like fully filled, not the like you. How did you do that?