dstpabuaran.com/app/Http/Controllers/Admin/Finance/PayrollController.php
Yoga Pangestu 23cc327190 Refactor code for improved readability and consistency across multiple files
- Adjusted indentation and formatting in login, permissions, profile, and security pages for better readability.
- Enhanced the clarity of conditional statements and function calls in permissions and profile components.
- Updated type definitions in vite-env.d.ts for better code structure.
- Cleaned up array mapping syntax in ProductTest.php for consistency.
2026-08-01 10:14:47 +07:00

36 lines
1019 B
PHP

<?php
namespace App\Http\Controllers\Admin\Finance;
use App\Http\Controllers\Controller;
use App\Models\Payroll;
use App\Services\Admin\Finance\PayrollPeriodService;
use Illuminate\Http\RedirectResponse;
class PayrollController extends Controller
{
public function __construct(
private PayrollPeriodService $service
) {}
public function pay(Payroll $payroll): RedirectResponse
{
return $this->handleAction(
fn () => $this->service->pay($payroll),
'Gaji berhasil dibayar.',
'admin.finance.payroll-periods.show',
parameters: ['payroll_period' => $payroll->payroll_period_id]
);
}
public function cancel(Payroll $payroll): RedirectResponse
{
return $this->handleAction(
fn () => $this->service->cancel($payroll),
'Gaji berhasil dibatalkan.',
'admin.finance.payroll-periods.show',
parameters: ['payroll_period' => $payroll->payroll_period_id]
);
}
}