fix: exclude Owner and Developer roles from payroll generation command

This commit is contained in:
Yoga Pangestu 2026-04-30 13:37:24 +07:00
parent 2ae9c0c470
commit 917e60c013

View File

@ -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 {