Sign in

A full-stack developer based in North Yorkshire, UK. 10+ years experience in multiple programming languages. Loves architecture principles and design.

Using Laravel in a side project recently, the introduction of Blade Components has been a literal gift for me. Creating reusable components is something we all want in our work process. Thankfully, as of Laravel 7+, you can do just that with a simple artisan command.

Let’s make a basic “Alert” component, then build on it to make it powerful.

Step 1: Create the component

Here, Laravel will create two new files:

  • App\View\Components\Alert.php
  • resources\views\components\alert.blade.php

You have a PHP component that collects data, and a view that delivers data. Simple!

Let’s look at the newly generated PHP file:


Please do not confuse this article with the real Peeple @ peeple.io. This is about a human mockery idea that has actually lost its trademark request to the real Peeple.

It’s no longer hard to tell in this day and age if an idea is simply a gimmick, stupid or actually, pretty amazing. People have preferences — each to their own — but for us, humble and sometimes gullible humans to believe in something, we have to be convinced. In a week, I've witnessed an ambitious yet ugly idea go from bad to worse in just one sentence:

“…there is…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store