<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController;

Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('/plomberie', [HomeController::class, 'plomberie'])->name('plomberie');
Route::get('/cvc', [HomeController::class, 'cvc'])->name('cvc');
Route::get('/isolation', [HomeController::class, 'isolation'])->name('isolation');
Route::get('/contact', [HomeController::class, 'contact'])->name('contact');

Route::get('/run-key-generate', function () {
    try {
        Artisan::call('key:generate', ['--force' => true]);
        return 'Key generated successfully!<br>' . nl2br(Artisan::output());
    } catch (\Exception $e) {
        return 'Error: ' . $e->getMessage();
    }
});

Route::get('/run-storage-link', function () {
    try {
        Artisan::call('storage:link');
        return 'Storage link created successfully!<br>' . nl2br(Artisan::output());
    } catch (\Exception $e) {
        return 'Error: ' . $e->getMessage();
    }
});
