repo_pattern/routes/api.php

28 lines
919 B
PHP
Raw Permalink Normal View History

2024-02-13 06:43:14 +00:00
<?php
2024-02-13 07:26:11 +00:00
use App\Http\Controllers\OrderController;
2024-02-13 06:43:14 +00:00
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
2024-02-13 07:26:11 +00:00
Route::get('orders', [OrderController::class, 'index']);
Route::get('orders/{id}', [OrderController::class, 'show']);
Route::post('orders', [OrderController::class, 'store']);
Route::put('orders/{id}', [OrderController::class, 'update']);
Route::delete('orders/{id}', [OrderController::class, 'delete']);