<?php

use App\Http\Controllers\PostController;
use App\Http\Controllers\ProfileController;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;

Route::get('/', function () {

    $logo = asset('images/logo.png');


    return Inertia::render('Home/Index',compact('logo'));
//    return Inertia::render('Welcome', [
//        'canLogin' => Route::has('login'),
//        'canRegister' => Route::has('register'),
//        'laravelVersion' => Application::VERSION,
//        'phpVersion' => PHP_VERSION,
//    ]);
})->name('/');

//Route::get('/dashboard', function () {
//    return Inertia::render('Dashboard');
//})->middleware(['auth', 'verified'])->name('dashboard');


Route::inertia('/dashboard', 'Dashboard')
    ->middleware(['auth', 'verified'])
    ->name('dashboard');

Route::middleware('auth')->group(function () {
    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');

    Route::resource('posts',PostController::class);

    Route::get('/test-tailwind',function (){
        return Inertia::render('Auth/TailwindLogin');
    })->name('test');

    Route::get('/tailwind-carousel',function (){

        $test = asset('/assets/images/1.jpg');

        return Inertia::render('Home/Carousel2',[
            'test'=>$test
        ]);
    })->name('carousel');

    Route::get('/tailwind-practice',function (){
        return Inertia::render('Home/Practice');
    })->name('practice');
});

require __DIR__.'/front_end/web.php';

require __DIR__.'/auth.php';
