How do I filter User Specific data in the widget?

I want the user to see only the graph of the data belonging to him, but I am not sure how to do it. For example, I need to filter according to the customer_id in the Orders model.
1 Reply
toeknee
toeknee2y ago
after between stop the var with ; The add an if(auth()->user() !== my manager/super user check) { $data->where('customer_id', auth()->user()->id); } And havbe the per month, count on another like with $data-> It refines it then, but you should look at the basic multi-tenancy if you can make that work for you.
Want results from more Discord servers?
Add your server