#16 Laravel Docker video course, common Nginx misconfigurations, and more

Welcome to the 16th Andy's Web Dev Tips newsletter! Here's a few things from the last couple weeks:

Develop and deploy Laravel applications with Docker

After being in the works for approximately 6 months, my first premium video course has been released. After exploring the twenty videos, text transcripts, and full source code, you’ll discover how to set up a rock-solid local dev environment for Laravel with Docker and deploy your Dockerized applications to a production server.

The course is friendly to both novices in Docker and Laravel, all the way up to those who might have moderate experience with either. Besides just development and deployment, there’s demonstrations on how to run Composer commands, use Redis to cache your application, or install frontend dependencies with npm, all inside of Docker. Zero dependencies need to be installed on your local machine.

You can click here to get the course, and it’s only $29.

Common Nginx misconfigurations

Configuring server software isn’t everyone’s cup of tea, and to some (like myself) it’s a pretty difficult thing to do right and can lead to headaches down the road if you miss something along the way.

I use Nginx in my day-to-day applications and projects, and so spend a lot of time in configuration files to make sure my web server is humming along without interruption. Well, out of the box, Nginx isn’t exactly a super secure system.

I found this super helpful blog article that lists out four different common misconfigurations with Nginx servers. Not only that, it provides detailed and concise instructions on why they’re problematic, and how to fix them. Plus, some pretty nice screenshots, too.

Automatic foreign keys in Laravel migrations

Laravel 8 has come with a breadth of new features, some super obvious, and some (like what I’m about to show you) hide away unnoticed in most applications.

Jason McCreary tweeted out the above image a few weeks ago, and this new foreignIdFor method on the Blueprint class is just such a small piece of perfection. Instead of having to hard code in the foreign id key you’re using (e.g. user_id), you can instead directly reference the model class here, and it will do the heavy lifting for you.

Streaming web development

Today I tried out something new and decided to stream me developing a project on Twitch and YouTube. I didn’t really plan much for it, mainly I was doing it to answer questions from the community and spend time working on the source code for my next video.

However, I think it’s something that I’d like to do more often, but with a purpose behind it. So, I’m asking for your help to determine what you’d like to see me build live, on stream. Check out this form here to give me your suggestions, and be sure to follow my Twitch channel if you’d like to get notified when I go live again!

Today I learned

This helpful hint comes from Miguel Piedrafita on Twitter. When using an email field in HTML forms, you can add in the multiple attribute on the input element. This will allow your user to enter a comma-separated list of email addresses and it will pass through to your server as an array of values!

That’s it for now! 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.