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
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.