Laravel 11 API in 13 minutes | Sanctum

Поделиться
HTML-код
  • Опубликовано: 13 апр 2024
  • Hello everyone,
    In this video, we will see Laravel 11 and changes done for Sanctum. We will also create a fundamental API.
    Laravel 10 Sanctum crash course
    • Laravel API with Sanct...
    Follow me on Twitter:
    / adir1521
    Follow me on LinkedIn
    / adityakadam2194
    Follow me on GitHub
    github.com/adityar15
    Website
    adiranids.com
    Discord
    / discord
  • НаукаНаука

Комментарии • 18

  • @skyand_fly
    @skyand_fly 3 дня назад

    Спасибо!

  • @ldcb6408
    @ldcb6408 2 месяца назад

    How did you config csrf token in Laravel?

  • @marwenkhefacha6887
    @marwenkhefacha6887 2 месяца назад

    i use Laravel11 sanctum session (not token) Login and logout (endpoints) are working correctly when called from postman but when I call other api end points it gives me 401 unauthorized

  • @HarsheenaNK
    @HarsheenaNK 2 месяца назад

    i would also like to know how you config csrf token.And can you create a project in laravel 11 for booking system

  • @tylerd.8529
    @tylerd.8529 2 месяца назад +5

    what is the code suggestion extension you use for VSCode?

  • @anujmgrroshan
    @anujmgrroshan Месяц назад +4

    It works, thanks. However there is a small problem.
    If I try to access the resources directly without providing the bearer token on api route, it tries to redirect to login route instead of returning unauthorized error. How do I fix it?

    • @kamauleao
      @kamauleao 7 дней назад +1

      Method 1:
      Add header: Accept: application/json
      Method 2:
      Manually validate Login using the Auth class

    • @anujmgrroshan
      @anujmgrroshan День назад

      @@kamauleao thanks

  • @KRAMDROIDTECH
    @KRAMDROIDTECH Месяц назад

    CSRF token mismatch. even the XSRF is set

  • @rickycaesar1263
    @rickycaesar1263 2 месяца назад +3

    when i try it, i get error "Page Expired" on register, any have same problem?

    • @thomaswikman2239
      @thomaswikman2239 2 месяца назад +2

      I had to add a new header variable key: X-XSRF-TOKEN, value: {{xsrf-cookie}}
      I can also suggest you add key: Accept, value: application/json (so that you actually see validation errors).

    • @GiampieroDiGregorio
      @GiampieroDiGregorio 16 дней назад

      @@thomaswikman2239 same thing, inserting the parameter in the header and the value doesn't change, too bad

  • @manishgautam2424
    @manishgautam2424 2 месяца назад

    superb, need more videos , i am basics Learner

  • @idepta5149
    @idepta5149 2 месяца назад

    best lesson bro! tnx so much!

  • @rajfekar1514
    @rajfekar1514 Месяц назад

    When I try without login it redirect to login page

    • @kamauleao
      @kamauleao 7 дней назад

      Method 1:
      Add header: Accept: application/json
      Method 2:
      Manually validate Login using the Auth class