Skip to content

Commit

Permalink
change auth request
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmpa committed Nov 24, 2022
1 parent b73627e commit 6e76124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/TimeTrackerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function report(Request $request)

$usersGroupByDate = TimeTracker::select('user_id','date')->whereBetween('date', [$fromDate, $toDate]);

if(Auth::user()->role_id == User::AGENT)
if( $request->user()->role_id == User::AGENT)
$usersGroupByDate = $usersGroupByDate->where('user_id', $request->user()->id);

$usersGroupByDate = $usersGroupByDate->groupBy(['user_id', 'date'])->get();
Expand Down

0 comments on commit 6e76124

Please sign in to comment.