#2 Two-factor auth, my favorite Laravel helpers, and more

Welcome to the 2nd Andy's Web Dev Tips newsletter! Here's a few things from this week:

Add in 2FA to your Laravel apps with this package

I came across this package by mateusjunges a few days ago, and while I haven’t had a chance to use it in a project yet, it’s very likely I’ll have an excuse to in the near future. Two-factor authentication is something I’ve been wanting to implement in a few different apps, but it was never requested enough for me to have an excuse to build it out from scratch.

However, this package looks super promising. Everything seems straightforward in the installation instructions. Include it with Composer, run your migrations, and add the HasTwoFactorAuthentication trait to your User model. A 2FA code is generated for their account and users are notified via Laravel’s built-in notification system.

My top 7 Laravel helper methods

I just published a new article on dev.to about my top seven Laravel helper methods, and how I’ve used them throughout various apps and site projects. If you’d like to skip the reading (and I don’t blame you), here’s a simplified list of my favorite helpers:

  • Str::limit()

  • head()

  • Str::between()

  • blank()

  • Str::contains()

  • Arr::pluck()

  • collect()

Check out the details for them and more helper methods in Laravel’s documentation.

Build a drawing app with Vue + HTML5 Canvas

An interesting tutorial that I saw in my feed this week, Wisdom Ekpot shows you how to use Vue and HTML5’s canvas element to create a basic drawing app. The canvas is something I’ve always chalked up to being this magical piece of the browser that I never really experimented with. But, me being familiar with Vue this seemed like a great excuse to try it out.

The tutorial is fairly short and sweet, but if you’d like to skip straight ahead and check out the source code it’s all available on the accompanying GitHub repo.

New Docker video being released this week

I’m currently working on a brand new video which should be released by Tuesday or Wednesday of this week. It’ll show you how to configure and run Docker locally for multiple Laravel app installations. Be sure to keep an eye out for when it publishes.

Also, as a quick note I surpassed 1,000 subscribers this week on my YouTube channel! It’s something I didn’t think would happen for quite a while, and I’m overwhelmed at the amount of support everyone has given me. I’ll continue producing videos on various Laravel, Vue, and Docker topics, and if you have any suggestions for a video you’d like to see, please don’t hesitate to reach out to me!

That’s it for this week! If you have any questions about the above, or have something you’d like me to check out, please feel free to let me know on Twitter.