<?php

namespace App\Http\Controllers;

use App\Services\DriverService;
use App\Traits\HasResponse;
use Illuminate\Http\Request;

class DriverController extends Controller
{
    use HasResponse;

    /** @var DriverService */
    private $driverService;

    public function __construct(DriverService $driverService)
    {
        $this->driverService = $driverService;
    }

    public function list(Request $request)
    {
        $withPagination = $this->validatePagination($request->only('perPage', 'page'));
        return $this->driverService->list($withPagination);
    }
}
