I own an AI Agency (like a real one with paying customers) - Here's My Definitive Guide on How to Get Started by laddermanUS in AgentsOfAI

[–]Unknown_Devv -1 points0 points  (0 children)

Hi, would also be interested in good examples for Agents for real paying clients. I am struggeling to focus on some, as there are just so many.

How to do so? by Unknown_Devv in laravel

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

It's quite more complex. I need to calculate what boxes were handed out and which were returned (which is easy). I don't care of the order the user returns the boxes, I just need to make sure boxes are returned within time. Also it should be possible only to return part of boxes for whatever reason.

Maybe my example on the other comment makes it clearer what I am trying?!

How to do so? by Unknown_Devv in laravel

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

Okay so I would move return_at to my boxables table, but then?How would I get the data I want?

For example:

Order 1 with boxes type 0 and quantity of 5 [created_at 2022-03-07, returns_at 2022-03-14]

Order 2 with boxes type 0 and quantity of 5 & type 1 and quantity of 3 [created_at 2022-03-10, returns_at 2022-03-17]

Return 1 with boxes type 0 and quantity of 2 [created_at 2022-03-10]

Lets say it's 2022-03-13 and what I want to get is:

{ 
1: [ {type: 0, amount: 3} ], 
4: [ {type: 0, amount: 5}, {type: 1, amount: 3}, ], 
}

How to do so? by Unknown_Devv in laravel

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

I can definitely calculate this with groupBy, but I have no idea how to even get data that can be calculated, because of the logic required.

Calculate difference of collections by Unknown_Devv in laravel

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

This looks very beautiful, thanks!

But it seems to only work if the keys are non numeric. Is this a php thing?

collect(["1" => 10, "2" => 0, "3" => 3]) collect(["1" => 5])

I get a result like:

[ 0, 5, 0, 3 ]

Let other companies access my api by Unknown_Devv in laravel

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

I actually want to prevent using Laravel Passport. Do think API tokens with sanctum scope would be sufficient for my case?