diff --git a/app/Console/Commands/GeneratePayrollCommand.php b/app/Console/Commands/GeneratePayrollCommand.php index 41c5178..da05cd3 100644 --- a/app/Console/Commands/GeneratePayrollCommand.php +++ b/app/Console/Commands/GeneratePayrollCommand.php @@ -33,7 +33,11 @@ public function handle() { $periodMonth = $this->argument('period') ?? Carbon::now()->format('Y-m'); $periodMonthFormatted = Carbon::parse($periodMonth)->translatedFormat('F Y'); - $users = User::with('profile')->get(); + $users = User::with('profile') + ->whereDoesntHave('roles', function ($query) { + $query->whereIn('name', ['Owner', 'Developer']); + }) + ->get(); $count = 0; try {