Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

api.php 895B

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);