How to Generate an Bearer Access Token | Laravel API Course | Learn Laravel API | Laravel API

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • In this video we will be creating an access token to grant a client permission to access the API - Learn how to create APIs in Laravel for its real-time communication support.
    📚 New Udemy Course
    If you're looking to level up your Laravel skills, my new course "Udemy Migirations, Seeders, Factories, Query Builder, Eloquent & Relationships" is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: www.udemy.com/...
    📲 Let’s plan a meeting
    Plan a (paid) 1-hour meeting on Calendly to do portfolio reviews, code reviews resume reviews or a coaching session for Laravel. Please read the description before booking: calendly.com/c...
    💌 Newsletter
    Sign up for my free weekly email newsletter: www.newsletter...
    🔥 Resources
    - PHP Hosting (10% DISCOUNT): www.hostinger....
    - TikTok: / codewithdary
    - Instagram: / codewithdary
    - Twitter: / codewithdary
    - Blog: blog.codewithd...
    - Newsletter: newsletter.cod...
    - Patreon: www.patreon.co...
    - GitHub: github.com/cod...
    Want to learn more?
    - Courses: / @codewithdary
    #laravel #laravel8 #laravelapi #api #bearer

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

  • @codewithdary
    @codewithdary  2 года назад +1

    LETS CONNECT THROUGH INSTAGRAM.
    instagram.com/codewithdary

  • @simeonanunciado1949
    @simeonanunciado1949 2 года назад +14

    for those getting error message Unauthenticated even the token is correct
    just replace laravel 8 prebuilt routes api
    Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
    });
    into
    Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
    });
    this is the solution greate tutorial sir dary godbless ^^

    • @shohagkhan3677
      @shohagkhan3677 2 года назад

      Thank you very much. I would have skipped this part of the tutorial, if I didn't get your comment.

    • @matthiku
      @matthiku 2 года назад

      It worked now and you made my day.
      Thank you, Sir!

    • @stevemasaki5295
      @stevemasaki5295 2 года назад

      Thank you

  • @hernanmartinezreumann3279
    @hernanmartinezreumann3279 3 года назад +2

    Excelent Course!! I'll keep you on my radar. Thanks!!

  • @techjavaid6177
    @techjavaid6177 3 года назад +2

    Awesome instructor on YT 💗

  • @Wolfgang190
    @Wolfgang190 3 года назад +2

    Hey! Thank you so much. Exactly what I was looking for. I just could not understand how to work correctly with these tokens.

    • @codewithdary
      @codewithdary  3 года назад +1

      Hi! I should that you for watching buddy!

  • @boredVAR
    @boredVAR Год назад +1

    I'm pretty sure Laravel Passport now has been upgraded, no need to add the routes function and in some cases when testing the access token, you'll realise that Auth guard [Passport] will not be executed for some reason

    • @codewithdary
      @codewithdary  Год назад +1

      Interesting, thank you for sharing. Haven't used it in a while but good to know!

  • @TheBubaololo
    @TheBubaololo 2 года назад +1

    Good content and very understandable explanation. But without user registration it all useless from practical point of view

  • @vahaggrigoruyan7228
    @vahaggrigoruyan7228 3 года назад +1

    Hey there dear god of Laravel i got one question , ould you please make a video of how to do the SEO right for various types of situations, we currently are really stuck on that question cause we got a seperated layouts and i dont know what to do in this kind of situation, its lke we got single app and home.blade.php layouts and we are yielding the main staff in between both of them by simply extending them from another directory , thank you for your videos they helped me a lot during development

    • @codewithdary
      @codewithdary  3 года назад +1

      Ha! Thank you Vahag! You can setup your database for that. Create a SEO table where you add meta_key etc. Create a pivot table per page so you can easily pull it in.

    • @vahaggrigoruyan7228
      @vahaggrigoruyan7228 3 года назад

      @@codewithdary thank you for the advise bro , guess something will be made no something great will be made

  • @dariosanchez1373
    @dariosanchez1373 3 года назад +1

    Thanks!

  • @adeyemiadeshina3988
    @adeyemiadeshina3988 2 года назад +1

    Thanks for the video. I have been contemplating on the difference between access token and api key. Api key is what we get mostly when using third party apis. How can api key be implemented Pls? Thanks for the help

    • @codewithdary
      @codewithdary  2 года назад

      Do you mean Oauth? That is mostly being used for third part apis.

  • @softwareEngineerKunwar
    @softwareEngineerKunwar 3 года назад +1

    Nice tutorial

  • @tanzimahmed2886
    @tanzimahmed2886 2 года назад +1

    having this error : "message": "Auth guard [api] is not defined.",

  • @Simonkaabi
    @Simonkaabi 3 года назад +1

    mr DARY can you do a video with nwidart/laravel-modules and what is the right way to make a laravel application as a SAAS ? for different clients ( while using the same database )

    • @codewithdary
      @codewithdary  3 года назад +3

      I'm working on the API course right now and I'm doing an authorization & authentication course after!

    • @Simonkaabi
      @Simonkaabi 3 года назад

      @@codewithdary No worries thanks for all the hard work it's appreciated a lot

  • @sasha3852
    @sasha3852 Год назад +1

    thank:)

  • @roxanar6780
    @roxanar6780 3 года назад +1

    Great! I love you ;)

  • @phpfact
    @phpfact 2 года назад +1

    Sir please Please Login And Registration Api create.... please please
    you are using tinker and run RAW command please make video special for Login + Registration

  • @ojaboemmanuel5417
    @ojaboemmanuel5417 2 года назад

    Mr dary how can i protect my API with a custom API middleware in laravel and also generate a token that will be used as a bearer token to access my endpoints

  • @krishnanarasimha1243
    @krishnanarasimha1243 3 года назад +1

    "error": "invalid_grant" -> can you please help me here?

    • @codewithdary
      @codewithdary  3 года назад

      It's either one of the following 3:
      - the client_id - client_secret pair don't match with each other
      - the id-secret pair isn't for a password_client but for a personal_access_client (check those columns in the oauth_clients table)
      - the password is wrong

  • @MiniPinho098
    @MiniPinho098 3 года назад

    I am considering joining ur patron to get access to the discord.

    • @codewithdary
      @codewithdary  3 года назад

      I mean, I think its worth it! Haha!

    • @MiniPinho098
      @MiniPinho098 3 года назад

      @@codewithdary I did it I'm a Patreon now haha. Your videos are great and I rly need help on my project so guess its a win-win situation hahha

  • @Simonkaabi
    @Simonkaabi 3 года назад

    i will be waiting for your answer

  • @stackpkofficial8518
    @stackpkofficial8518 2 года назад +1

    if love had a face :)

  • @arashbahariye138
    @arashbahariye138 Год назад

    anyone can pickup whats written inside the documentation and make a video out of it. the important part is to explain what are the pieces and why they should be in place. this is what your tutorial lacks. i recommend you watch this tutorial over the same concept so that you can notice the difference:
    ruclips.net/video/YGqCZjdgJJk/видео.html

    • @codewithdary
      @codewithdary  Год назад

      I'm good brother, take care watching that tutorial.