Ezrab_

Ezrab_

Member Since 1 Year Ago

Experience Points
130
Total
Experience

4,870 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
130 XP
Mar
26
1 week ago
Activity icon

Replied to Laravel Passport Guide

Thanks again for your reply!

So I read some articles on where to store the access_token. One article pointed out that it would be best to put the token crypted in a cookie.

What do you think is the best way to store the token and where should I start when writing the logic on where to store it the token?

Looking forward to hear back from you :-)

Mar
24
1 week ago
Activity icon

Replied to Laravel Passport Guide

First of all I'd like to thank you very much for your time and effort in your answer. Now some questions.

  • When you register a user doesn't the user get an access_token, and if not how do you log the user in? Seems like a bad user experience to let the user log in with the credentials they just filled in.
  • How do you validate that the token is still valid and if not how do you give them a new one?
  • Aren't you using any custom Controllers to handle the registration and login part? Because that's what I see a lot on the internet when looking at how other people implement passport.

Thanks in advance! :-)

Activity icon

Replied to Laravel Passport Guide

Yeah I want to use the password grant_type I think.

I have for my frontend a React App running on one server

And for my backend I have this Laravel app running. And I want to use Laravel's power to do the following:

  • register
  • login
  • define gates
  • automatically request new access token if it expires via the refresh token

I hope this clears it up

Activity icon

Started a new Conversation Laravel Passport Guide

I'm trying to find a good trustworthy guide to setup laravel with react. Does anyone know where to find such guide. I would like to know how to set it up and use it to:

  1. Register users
  2. Log users in
  3. Define gates

I know people will tell me to read the official docs, but they are a little bit hard for me to understand with implementing these features. So any guides that are trustworthy would be very much appreciated.

Mar
21
2 weeks ago
Activity icon

Started a new Conversation Sanctum Csrf Cookie

I'm using Laravel sanctum (former Airlock) and have a question about it. I read in the docs:

To authenticate your SPA, your SPA's login page should first make a request to the /sanctum/csrf-cookie > route to initialize CSRF protection for the application:

axios.get('/sanctum/csrf-cookie').then(response => {
// Login... });

Once CSRF protection has been initialized, you should make a POST request to the typical Laravel /login route. > This /login route may be provided by the laravel/ui authentication scaffolding package.

Does this mean that for every request I make, I should first check if the cookie has already been set? Because let's say I have a user that registers. Before making the POST request to register a user I should first make a GET request to get the CSRF-Cookie from my backend and then make the POST request to register the user.

Now the user gets redirected to the login webpage and is asked to login. Does the frontend then first have to check if there's a CSRF-Cookie, and if there isn't should it first again make the GET request to get the cookie?

This last bit also confuses me, because when calling the register method a user doesn't actually get logged in so the user has to be redirect to the login page to log in with the credentials the user just filled in to register which for me seems like a bad user experience, right?