- 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.
18 lines
551 B
PHP
18 lines
551 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\AuthController;
|
|
use App\Http\Controllers\TaskController;
|
|
|
|
// Auth - wajib pakai check.token
|
|
Route::middleware(['check.token'])->group(function () {
|
|
Route::post('/register', [AuthController::class, 'register']);
|
|
Route::post('/login', [AuthController::class, 'login']);
|
|
});
|
|
|
|
// Protected Routes
|
|
Route::middleware(['auth:sanctum'])->group(function () {
|
|
Route::apiResource('tasks', TaskController::class);
|
|
Route::post('/logout', [AuthController::class, 'logout']);
|
|
});
|