<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AreaController;
use App\Http\Controllers\NoteController;
use App\Http\Controllers\PagoController;
use App\Http\Controllers\PlanController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\MedioController;
use App\Http\Controllers\NivelController;
use App\Http\Controllers\PlaneController;
use App\Http\Controllers\TurnoController;
use App\Http\Controllers\CampanController;
use App\Http\Controllers\StripeController;
use App\Http\Controllers\CarreraController;
use App\Http\Controllers\CodeController;
use App\Http\Controllers\PlantelController;
use App\Http\Controllers\ConceptoController;
use App\Http\Controllers\DurationController;
use App\Http\Controllers\MailController;
use App\Http\Controllers\MaterialController;
use App\Http\Controllers\ProspectoController;
use App\Http\Controllers\PermissionController;
use App\Http\Controllers\StripeWebhookController;
use Laravel\Jetstream\Http\Controllers\Livewire\UserProfileController;

Route::get('/',function(){return view('auth.login');});
Route::get('/prueba',function(){return view('prueba.index');});
Route::post('/stripe/webhook', [StripeWebhookController::class, 'handle']);

Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
    ])->group(function () {

    Route::middleware(['auth'])->group(function () {

        Route::resource('/area',AreaController::class);
        Route::get('/dashboard', function () {return view('dashboard');})->name('dashboard');
        Route::resource('/campan',CampanController::class);
        Route::resource('/carrera',CarreraController::class);
        Route::resource('/code',CodeController::class);
        Route::resource('/concepto',ConceptoController::class);
        Route::resource('/duration',DurationController::class);
        Route::resource('/material',MaterialController::class);
        Route::resource('/medio',MedioController::class);
        Route::resource('/nivel',NivelController::class);
        Route::resource('/note',NoteController::class);
        Route::resource('/pago',PagoController::class);
        Route::post('/pagar/{pago}', [StripeController::class, 'pagar'])->name('pagar');
        Route::get('/pagar/{status}', [StripeController::class, 'show'])->name('pagar.show');
        Route::get('/perfil', [UserProfileController::class, 'show'])->name('perfil');});
        Route::resource('/permission',PermissionController::class);
        Route::resource('/plan',PlanController::class);
        Route::resource('/plane',PlaneController::class);
        Route::resource('/plantel',PlantelController::class);
        Route::resource('/prospecto',ProspectoController::class);
        Route::resource('/role',RoleController::class);
        Route::resource('/turno',TurnoController::class);
        Route::resource('/user',UserController::class);
        Route::resource('/mail',MailController::class);
        Route::get('/mailme/{user}',[MailController::class,'mailme'])->name('mailme');

    });
