<?php

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Koneko\VuexyAdmin\Application\Bootstrap\Manager\KonekoModuleBootManager;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        //
    })
    ->withExceptions(function (Exceptions $exceptions) {
        //
    })
    ->withSchedule(function (Schedule $schedule) {
        $schedule->call(function () {
            logger()->info('[Test Job] ✅ Programación básica funcionando.');
        })->everyMinute();

        app()->booted(function () use ($schedule) {
            KonekoModuleBootManager::scheduleAll($schedule);
        });
    })
    ->create();
