Sending a welcome notification to new users of a Laravel app

Original – by Freek Van der Herten – 7 minute read

My team and I currently building Mailcoach, a solution to self-host newsletters and email campaigns. In Mailcoach you can create new users to use the app.

How should these new users be onboarded? The easy way out would be to send these new users a default password reset notification to those users, but that isn't a good first experience. The default auth scaffold by Laravel doesn't help us here: it only contains functionality to log in and to let users register themselves.

To onboard new users created by other users, I've created a package called laravel-welcome-notification which can send a welcome notification to new users that allows them to set an initial password.

In this blogpost I'd like to explain how you can use the package).

Read more

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.

Build your own React

Link – – pomb.us

In a very cool post, Rodrigo Pombo explains the internals of React by rewriting it's core from scratch.

We are going to rewrite React from scratch. Step by step. Following the architecture from the real React code but without all the optimizations and non-essential features.

Read more [pomb.us]

Closing Modals with the Back Button in a Vue SPA

Link – – jessarcher.com

Jess Archer recently gave an excellent talk at Laracon AU. In a new blogpost she explains one one tips given during her talk: how to close modals in a Vue app by using the back button.

On most web apps, pressing the back button while a modal dialog is open will navigate to the previous page, rather than closing the modal. This can be very frustrating! It might not seem like a huge deal on a desktop app, but on a mobile, where a modal like this will often be full-screen, and with phones having back buttons and back gestures, I believe it's a huge user experience improvement.

Read more [jessarcher.com]

Creating custom relations in Laravel

Link – – stitcher.io

My colleague Brent solved a performance by creating a custom relation

One last solution that came to mind was to load all people, all contracts, and map them together manually. In the end that's exactly what I ended up doing, though I did it in the cleanest possible way: using custom relations.

Read more [stitcher.io]

Crafting maintainable Laravel applications

Link – – jasonmccreary.me

At Laracon AU, Jason McCreary gave an excellen talk on how to create maintainable Laravel apps. On his blog he published a written down version of the talk.

Being the author of BaseCode and creator of Shift gives me a unique insight into writing Laravel applications. I combined 20 years of writing code with supporting over 20,000 Laravel upgrades into 10 tips for crafting maintainable Laravel applications.

Read more [jasonmccreary.me]

Writing open source software, and staying sane while at it

Link – – sebastiandedeyne.com

My colleague Seb lists a few very good actionale tips that help you maintaining open source software.

In the 4.5 years I’ve been a developer at Spatie, over 200 packages have been built and released by our team. I’ve done quite some authoring and maintenance over the years, and I’d like to share 8 actionable tips on writing and maintaining open source software without going insane.

Read more [sebastiandedeyne.com]

Getting started with Domain Oriented Laravel

Original – by Freek Van der Herten – 1 minute read

A couple of days ago my colleague Brent published a blogpost on Domain Oriented Laravel. In short, he makes the case for organising your code around business concepts or features. That might sound very "heavy" or daunting, but it's actually for easy to get started with.

In this short video I explain how you can use PhpStorm to refactor your code. Make up your own mind if you need this in your projects.

Read more

Persistent Layout Patterns in Next.js

Link – – adamwathan.me

Adam Wathan explain how can avoid re-rendering the entire UI everytime you click a link in Next.js

Next.js is such a wonderfully productive development experience and produces such incredibly fast websites that I just refused to believe it had to be this way. So I spent a few weeks researching, asking questions, and experimenting, and came up with these four patterns for persistent layouts in Next.js applications.

Read more [adamwathan.me]

Query scopes, meet action scopes

Link – – timacdonald.me

Tim MacDonald shares an interesting technique.

Action scopes are...well...just query scopes really, but instead of filtering they take an action. It's just a random name I've given them to differentiate them from regular filtering based query scopes in my projects.

Read more [timacdonald.me]

The mixin PHP DocBlock

Original – by Freek Van der Herten – 5 minute read

When using PHP, you've probably used DocBlocks. They can be used to add additional information that can't be inferred by looking at the source code alone. DocBlocks can be used by IDEs, like PhpStorm, to improve autocomplete suggestions.

In this blogpost, I'd like to highlight a not so well known DocBlock: mixin.

Read more

A Micro-Manager’s Guide to Chilling Out

Link – – forge.medium.com

Don't try to manage your colleagues too much.

Employees want to be managed by people who empower them, not manage every bit of their day. The better you get at hitting the right balance between oversight and autonomy, the more likely you are to win long-term fans who will advocate for you as your career progresses.

Read more [forge.medium.com]