<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserController;
use App\Http\Controllers\SubscriberController;
use App\Http\Controllers\AdminController;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', [SubscriberController::class, 'welcome'])->name('welcome');


Route::get('/login', [UserController::class, 'login'])->name('login');
Route::get('/register', [UserController::class, 'register'])->name('register');
Route::post('/reg', [UserController::class, 'reg'])->name('reg');
Route::post('/auth', [UserController::class, 'auth'])->name('auth');

Route::middleware('auth')->group(function () {
    Route::get('/cabinet', [UserController::class, 'cabinet'])->name('cabinet');
    Route::get('/logout', [UserController::class, 'logout'])->name('logout');
    Route::get('/trafic/{trafic}', [SubscriberController::class, 'trafic'])->name('trafic');
    Route::get('/deletetrafic/{trafic}', [AdminController::class, 'deletetrafic'])->name('deletetrafic');
    Route::post('/createtrafic', [AdminController::class, 'createtrafic'])->name('createtrafic');  
}); 