| 123456789101112131415161718192021 |
- <?php
- namespace App\Http\Controllers;
- use App\Models\ImportLog;
- use Illuminate\Http\JsonResponse;
- class ImportLogController extends Controller
- {
- public function index(string $type): JsonResponse
- {
- $perPage = (int) request('per_page', 10);
- $logs = ImportLog::where('type', $type)
- ->with('user:id,name')
- ->orderByDesc('imported_at')
- ->paginate($perPage);
- return $this->successResponse(payload: $logs);
- }
- }
|