Multiple forms with same input names on one page

Link – stefanbauer.me

Stefan Bauer explains how to handle error message when you have multiple forms on one page

Here's another tip! Even if it's documented here I just wanted to show it. Here's the deal: Imagine you have multiple forms one page. For example one contact form and another newsletter signup form. Both of them might have an email field. So who do you know which email field doesn't validate and throws an error?

Read more [stefanbauer.me]

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Supercharging common controllers

Original – by Freek Van der Herten – 2 minute read

From time to time our team needs to create fairly complicated CRUD interfaces from scratch. While this isn't rocket science, there surprisingly aren't that many good resource out there on how to do this. That's why our team dove in and published a couple of packages that can help create modern CRUD…

Read more

Automatically detect broken links after a deploy

Link – ohdear.app

You can use the Oh Dear! API to automatically perform health checks on your app after a deploy.

You can use our API to trigger an on demand run of both the uptime check and the broken links checker. If you add this to, say, your deploy script, you can have near-instant validation that your deploy succeeded and didn't break any links & pages.

Read more [ohdear.app]

JAMstack as a beginner

Link – dev.to

I hear more and more people talking about JAMstack. Here's a good post that explains what it is.

JAMstack is am excellent way to build fast, secure and static websites. (keep in mind, not every JAMstack website has every element of the JAM - the core feature that they all have in common is that they are serverless)

Read more [dev.to]

Lazy collections in Laravel

Link – github.com

Unsung Laravel hero Joseph Silber opened up a very interesting PR to Laravel. Let's hope this one gets accepted.

Whereas the existing Collection class wraps a native array, the new LazyCollection class wraps a native iterator, while still providing most of the methods that we know and love from a regular collection.

Read more [github.com]

4 Ways The Laravel Service Container Helps Us Managing Our Dependencies

Link – christoph-rumpel.com

Christoph Rumpel wrote a clear post on how you can use Laravel's service container.

The service container is a quite complex topic, and I see many struggling to understand what it does. It was the same for me, and the main reason is that many explanations concentrate on "how" to use the container. With this article, I want to give you my introduction to this topic by focusing on the "why" and "when" the container can help us with our dependencies.

Read more [christoph-rumpel.com]

10 rules to code like NASA (applied to interpreted languages)

Link – dev.to

Here a some great tips on how to write robust software.

NASA's JPL, which is responsible for some of the most awesomest science out there, is quite famous for its Power of 10 rules (see original paper). Indeed, if you are going to send a robot on Mars with a 40 minutes ping and no physical access to it then you pretty damn well should make sure that your code doesn't have bugs.

Read more [dev.to]

Laravel and Murphy’s Law

Link – medium.com

Patrick Brouwers, the creator of Laravel Excel, explains how to handle failing jobs in Laravel

When designing software, don’t only think about the happy path. Write down (preferably with (unit) tests) what all the things are that could go wrong. Then design your solution to be able to recover those situations. (Wether or not automatic.) There isn’t a single solution to rule them all, some processes might need to have specific failure handling while others are fine with the default approach.

Read more [medium.com]

Some Shifty Bits

Link – jasonmccreary.me

Laravel Shift creator JMac did a write up of the talk he gave at this year's Laracon US

I received a lot of valuable feedback from these talks. So I combined them by using analytics from Shift to identify underutilized features of Laravel and demonstrate them with code.

Read more [jasonmccreary.me]

Cost & Performance optimization in Laravel Vapor

Link – divinglaravel.com

Mohammed Said shares some solid tips on optimizing costs when working in a serverless environment like Laravel Vapor

Laravel Vapor uses different AWS resources to efficiently get your application up and running in the serverless cloud. The building block of the whole thing is AWS Lambda, it's where the actual computing happens. Calculating the cost of the compute part for your application can be a bit confusing, so let's simplify it a bit with an example.

Read more [divinglaravel.com]

Viewing model counts in the Laravel Debugbar

Link – reinink.ca

Jonathan Reinink has added a very usefull metric to Laravel debugbar

Last week at Laracon US I gave a talk titled Eloquent Performance Patterns. In that talk I used a custom Laravel Debugbar metric I created to track how many Eloquent models were being hydrated throughout a request. I've had a lot of people asking about this, so today I submitted a pull request to the Laravel Debugbar to add this as an official metric.

Read more [reinink.ca]

Why Build X When Y Exists?

Link – davidhemphill.com

In a new post David Hemphill argues that you sure can (re)build something that already exists. I fully agree.

Some folks ask this rhetorically, implying there's no good reason when something similar already exists. They ask this question with a smug grin and think they've got you.

Read more [davidhemphill.com]

There’s more than one way to write an IP address

Link – ma.ttias.be

Mattias Geniar explains all the ways an IP address can be written.

Most of us write our IP addresses the way we've been taught, a long time ago: 127.0.0.1, 10.0.2.1, ... but that gets boring after a while, doesn't it. Luckily, there's a couple of ways to write an IP address, so you can mess with coworkers, clients or use it as a security measure to bypass certain (input) filters.

Read more [ma.ttias.be]