- Created api.php for handling authentication routes (register, login, logout) with token middleware. - Implemented task management routes using API resource controller. feat: add console routes for artisan commands - Added console.php to define an inspiring quote command. feat: add web routes for homepage - Created web.php to serve the welcome view at the root URL. chore: add .gitignore files for storage directories - Added .gitignore files in storage/app, storage/framework, and storage/logs to exclude unnecessary files from version control. test: add feature and unit tests - Created ExampleTest in Feature and Unit directories to verify basic application responses and assertions. build: add Vite configuration for Laravel and Tailwind CSS - Added vite.config.js to configure Vite with Laravel and Tailwind CSS for asset management.
27 lines
893 B
PHP
27 lines
893 B
PHP
<?php
|
|
|
|
use App\Http\Middleware\CheckToken;
|
|
use App\Http\Middleware\ForceJsonResponse;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
->withRouting(
|
|
web: __DIR__ . '/../routes/web.php',
|
|
api: __DIR__ . '/../routes/api.php',
|
|
commands: __DIR__ . '/../routes/console.php',
|
|
health: '/up',
|
|
)
|
|
->withMiddleware(function (Middleware $middleware): void {
|
|
$middleware->api(prepend: [
|
|
ForceJsonResponse::class // dijalankan pertama sebelum semua request API
|
|
]);
|
|
$middleware->alias([
|
|
'check.token' => CheckToken::class, // dipanggil manual di route
|
|
]);
|
|
})
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
//
|
|
})->create();
|