<?php

namespace App\Http\Controllers\Log;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Log;
use App\Http\Resources\LogsResource;

class LogsController extends Controller
{
    public function index(Request $request)
    {
        $res = Log::query()
            ->orderBy('id', 'desc')
            ->with(['user:id,name'])
            ->filter()
            ->paginate();

        return LogsResource::collection($res);
    }
}
