Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627
  1. <?php
  2. use App\Http\Controllers\Api\APIController;
  3. use App\Http\Controllers\SessionController;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Support\Facades\Route;
  6. /*
  7. |--------------------------------------------------------------------------
  8. | API Routes
  9. |--------------------------------------------------------------------------
  10. |
  11. | Here is where you can register API routes for your application. These
  12. | routes are loaded by the RouteServiceProvider and all of them will
  13. | be assigned to the "api" middleware group. Make something great!
  14. |
  15. */
  16. Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
  17. return $request->user();
  18. });
  19. Route::apiResource('user', APIController::class);
  20. // Login
  21. Route::get('/login', [SessionController::class, 'index']);
  22. Route::post('/login', [SessionController::class, 'login']);
  23. // Route::apiResource('login', SessionController::class);