forge/bootstrap/app.php
Refringe 75ebc827dc
Carbon dynamicFormat macro
Adds a dynamicFormat macro/method on the Carbon facade to handle the logic of conditionally formatting the dates based on the difference to the current time.

Logic pulled from #48 (Thanks Waffle!)
Issue #45
2024-09-09 23:14:30 -04:00

29 lines
877 B
PHP

<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\Route;
use Mchev\Banhammer\Middleware\IPBanned;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
then: function () {
Route::middleware('api')
->prefix('api/v0')
->name('api.v0.')
->group(base_path('routes/api_v0.php'));
},
)
->withMiddleware(function (Middleware $middleware) {
$middleware->append(IPBanned::class);
})
->withExceptions(function (Exceptions $exceptions) {
//
})
->create();