antoine_l

antoine_l

Software Engineer at Paris

Member Since 1 Year Ago

Experience Points
21,050
Total
Experience

3,950 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
199
Lessons
Completed
Best Reply Awards
1
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 5
21,050 XP
Aug
10
3 months ago
Activity icon

Replied to Best Way To Implement An OTP System On A Stateless API?

@bobbybouwmann Yes but I can not rely only on localStorage since it can be altered by the user

Activity icon

Started a new Conversation Best Way To Implement An OTP System On A Stateless API?

Hello,

I need to integrate an OTP system (One Time Password) to an API using Sanctum.

  1. The user logins
  2. He receives an OTP code by SMS or mail
  3. He fills the code on the app
  4. Then he can access to his account

But since it's an API, my routes are under the api middleware and not web : I can not use a session.

So, how do I store whether or not my user has passed the OTP step?

I need to save this information in order to authorize or not other requests.

Jul
23
4 months ago
Activity icon

Awarded Best Reply on Facing Problem With Sending Mails In Laravel.

You defined that your ContactMail constructor must receive an instance of App\User as first parameter, but you sent $request->input('name') which is a string. You need to pass a User instance.

For example:

class SellerController extends Controller
{
    public function index(User $user)
    {
        return view('front-end.contact', compact('user'));
    }

    public function send(Request $request)
    {
        Mail::to($request->email)
            ->send(new ContactMail(auth()->user(), $request->input('message')));

        return back();
    }
}
class ContactMail extends Mailable
{
    use Queueable, SerializesModels;

    public $buyer;
    public $message;

    /**
     * Create a new message instance.
     *
     * @param User $buyer
     * @param string $message
     * @return void
     */
    public function __construct(User $buyer, $message)
    {
        $this->buyer = $buyer;
        $this->message = $message;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.contactSeller')->with([
	    'buyer' => $this->buyer,
            'message' => $this->message,
        ]);
    }
}
@component('mail::message')


{{ $buyer->name }} wants to connect with you.

<p>
    {{ $message }}
</p>
Please contact him with his Phone number which is {{ $buyer->phone}}

Thanks,<br>
{{ config('app.name') }}
@endcomponent
Activity icon

Replied to Facing Problem With Sending Mails In Laravel.

You defined that your ContactMail constructor must receive an instance of App\User as first parameter, but you sent $request->input('name') which is a string. You need to pass a User instance.

For example:

class SellerController extends Controller
{
    public function index(User $user)
    {
        return view('front-end.contact', compact('user'));
    }

    public function send(Request $request)
    {
        Mail::to($request->email)
            ->send(new ContactMail(auth()->user(), $request->input('message')));

        return back();
    }
}
class ContactMail extends Mailable
{
    use Queueable, SerializesModels;

    public $buyer;
    public $message;

    /**
     * Create a new message instance.
     *
     * @param User $buyer
     * @param string $message
     * @return void
     */
    public function __construct(User $buyer, $message)
    {
        $this->buyer = $buyer;
        $this->message = $message;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.contactSeller')->with([
	    'buyer' => $this->buyer,
            'message' => $this->message,
        ]);
    }
}
@component('mail::message')


{{ $buyer->name }} wants to connect with you.

<p>
    {{ $message }}
</p>
Please contact him with his Phone number which is {{ $buyer->phone}}

Thanks,<br>
{{ config('app.name') }}
@endcomponent
Activity icon

Replied to Notification Not Sent

Using Notification::fake(), you are mocking your notification. It prevents notifications from being sent for real, and it allows you to assert it was sent. So even if your test passes, don't expect to get I was here in your log.

About your assertion, are you sure you imported UserInvited::class in your test file?

Activity icon

Replied to Facing Problem With Sending Mails In Laravel.

What error do you get?

Jun
26
5 months ago
Activity icon

Replied to Laravel Testing With Auth::once() Permanently Authenticates User

Hello @manuelsteiner

I'm having the same problem. I use Auth::onceUsingId(...). By using it, I log a user into the application for a single request. No sessions or cookies is utilized.

However, in my test after making a request to a route that uses Auth::onceUsingId(), I'm still authenticated. It means I can make other requests that require authentication. But for these other requests, I should be a guest, not an authenticated user.

Have you found a solution since then?

Thanks!