<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| 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('/', [\App\Http\Controllers\MailController::class, 'index'])->name('index');
Route::get('/custom', function () {
    return view('custom');
})->name('custom');

Route::post('/mail', [\App\Http\Controllers\MailController::class, 'get'])->name('mail_list');
Route::post('/mail/{id}', [\App\Http\Controllers\MailController::class, 'info'])->name('mail_info');

Route::get('/refresh-csrf', function () {
    return response()->json(['csrfToken' => csrf_token()]);
});
Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::post('/home/total', [App\Http\Controllers\HomeController::class, 'total'])->name('home_total');
Route::post('/home/mail/{id}', [App\Http\Controllers\HomeController::class, 'info'])->name('home_mail_info');
Route::any('/home/address', [App\Http\Controllers\HomeController::class, 'address'])->name('home_address');
