Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Browse all series

Playing With PHP

This series is all about the little projects you build once you're off the clock. One topic per section, we'll toy with the fringes of PHP to, for example, blink our lights when a PHPUnit test fails. Why bother? Because it's fun! Come along and join me.

Progress

Series Info

Episodes
8
Run Time
2h
Difficulty
Intermediate
Last Updated
Feb 24, 2021
Version
Latest

Series Episodes

  1. The Phillips Hue API (3)
    1. The Hue REST API

      To begin, let's have a look at the Philips Hue REST API. We'll figure out how to toggle the lights in our room and adjust their colors.
    2. Build a Client App Using Vue

      Now let's leverage Vue 3 and Tailwind to build a simple client app that allows us to control our lights from any web browser.
    3. Hook Into PHPUnit's Pass/Fail Events

      We can hook into PHPUnit's events, like for passing or failing tests, to change the color of our lights accordingly. GitHub Repo: https://github.com/drehimself/lc-hue-phpunit
  2. How's the Weather (5)
    1. Introduction and Styling

      Let's begin by styling our app with Tailwind CSS and extracting it to a Blade component.
    2. Fetch Weather Data With the OpenWeather API

      We can use the OpenWeather API along with Laravel's HTTP client to fetch data for our current and future forecasts.
    3. Leverage Algolia Places

      We can make our application more interactive by pulling in Algolia Places for our dropdown of cities. The query string will help us keep track of the currently selected city and keep the majority of logic on the backend.
    4. Extract to a Vue Component

      Let's now make our Weather widget interactive by extracting it to a Vue component. We'll move much of the logic over from Laravel into Vue and allow it to update whenever the location is changed from the Places API.
    5. Use Livewire

      We can also use Livewire to make our weather widget interactive. We'll re-use much of the logic from the Blade components we created, but make a few changes to make it work with Livewire. We'll also pull in Alpine.js for some simple DOM manipulation.

Continue Learning