<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class DillerController extends Controller
{
    public function __invoke(Request $request)
    {
        $size = $request->get('size', 20);
        $dillers = DB::table('users')->whereRaw('LOWER(role) = ?', ['diller'])->paginate($size);
        $user = auth()->user();
        return view('diller.index', compact('dillers', 'user', 'size'));
    }
}
