It's not something new, but it's probably not known well enough: by surfing on any Github repository like f.i. https://github.com/cavo789/blog, you can just press . (the dot key) on your keyboard to start vscode online i.e. see the current repository in vscode.dev.
Laravel Filament
Filament is a collection of beautiful full-stack components. The perfect starting point for your next app. i.e. a set of free-to-use components and promises that we'll be able to quickly build nice administration interfaces.
The competitor of Filament is the official Laravel Nova which is a paid software.
Filament is built using the latest technologies: the TALL stack. This acronym sums up the technologies used: Tailwind, Alpine, Laravel and Livewire.
Sticky scroll in vscode
vscode has recently added a really useful new feature: sticky scroll.
This function allows you to scroll through a document such as a Markdown file, a source code written in PHP or JavaScript or any other supported language and, as you scroll, block contextual information such as the name of the class, the name of the function, the start of the loop, etc. in the upper part of the editor.
Docker - Diagrams as code
But what a joy it is to be able to draw diagrams by, well, just writing text. Some tools are better known than others, e.g. Mermaid.
Did you know https://diagrams.mingrammer.com/? Let's explore it using, of course, a Docker ready-to-use image.
Working with Laravel events
When I started developing for the Joomla CMS (that was 15 years ago, in 2009), one of the things I liked most was the notion of events.
For example An article is about to be posted, An article has been posted, A user has registered, ... i.e. actions that are announced by the CMS and to which you can react.
When An article is about to be displayed is generated, you can have one (or more) pieces of code interact with this event. You can add dynamic content, you can also deny the article to be displayed if certain conditions are not met.
Using volumes with Docker, use cases
When working with a Docker container, data can be persistent or not. Imagine you're creating a localhost website with Joomla, Wordpress or any other tool (Laravel, Symfony, etc.).
You've perfectly created the various Docker files needed to run the local site, you've run the command docker compose up --detach
to start the containers and now you're busy installing the site. After a few moments, your local site is up and you can start developing its functionalities.
By default, if you haven't taken any precautions, the moment you stop the container (docker compose down
), you'll kill your site, i.e. by default, having not taken care to save your data (your site, your database), everything will be lost and reset the next time you run docker compose up --detach
. Well... Maybe that was your wish (something totally ephemeral); maybe not;
FrankenPHP, a modern application server for PHP
Version updated on November 21, 2023 after a discussion with Alexandre about making his Docker image available on hub.docker.com
Based on their documentation, FrankenPHP is 3.5 faster than PHP FPM.
It is still fairly young for use on production sites, but because it's so promising, it's certainly worth playing with when developing locally.
Alexandre Elisé has written a script to use FrankenPHP with Joomla. You can find the source here: https://github.com/alexandreelise/frankenphp-joomla.
Update all out-of-date Windows programs in batch
If you're working under Linux or WSL, you know very well the sudo apt-get update && sudo apt-get upgrade
instruction to ask the operating system to upgrade programs present on your disk with newer version.
Under Windows, since a few years (starting with Windows 10), there is such command too: it's winget
.
Create your Joomla website using Docker
In this article, we will learn how to use Docker to install Joomla on your localhost and start a new website in seconds (don't want to wait? Jump to the Final docker-compose.yml chapter).
I will use a Linux console (I'm running WSL on my Windows computer and I have chosen Ubuntu for my distribution) but since Docker can also be used on Windows, you can perfectly run, exactly, the same commands in an MS-DOS / Powershell console.
Share data between your running Docker container and your computer
If you don't have Docker yet, please consult my Install Docker and play with PHP post first.
When running Docker without specifying a volume, everything done during the execution of Docker is done in memory. In other words: if the PHP script you run from Docker creates folders or files, these will never be created on your disk. They will be created exclusively in memory.