Archive.
76 guides and notes on Laravel and PHP, written between 2020 and 2023.
2023.
5 articles-
How to install private Composer packages in GitHub Actions
In this tutorial I'll show you how to install private Composer packages via GitHub Actions.
-
How to use Custom Slots in full page Livewire components
In this tutorial I'll show you how to use slots in Livewire full page components in Laravel.
-
How to send messages from Laravel to Slack (2023 version)
In this tutorial I'll show you how to create a Slack app to send messages to Slack channels. I'll also show the best way to send custom notifications using Laravel to a Slack workspace.
-
How to get the size of a directory or file on Linux in human readable format (2023)
In this tutorial I'll show you how to get the human readable size of folders and files on Linux.
-
How to get the total database size in MySQL using a query
In this tutorial I'll show you how to get the total database size in MySQL using a simple SELECT statement.
2022.
22 articles-
How to force Composer to use a specific PHP-version
In this tutorial I'll show you how to force Composer to use a specific PHP-version. This will allow you to override the PHP-version and generate a compatible lock-file for your server.
-
Deep dive into Carbon – Laracon Summer 2022 Recap
This article is a recap of my talk at Laracon Summer 2022, where I gave a talk about Carbon. The title was "Deep Dive into Carbon" and I showed some handy Carbon tricks.
-
How to filter outgoing emails in Laravel (2023)
In this tutorial I'll show you how to filter outgoing emails in Laravel. I'll show you how to stop an email just before it's being sent, so that you are in control.
-
My experience becoming a Laravel Certified Developer
In this article I'll describe the process of becoming an Official Laravel Certified Developer. I tell about the procedure and my experience with the exam.
-
How to use "git clone" with a custom SSH key
In this article I'll show you how to use a custom SSH-key with a Git-repository.
-
How to get the current and previous URL in Livewire (new package 💫)
In this tutorial I'll show you how to get the current URL/route in Laravel Livewire and how to get the previous URL/route in Livewire.
-
How to fix the Laravel “No morph map defined for model” error
In this tutorial I'll show you how to fix the Laravel "No morph map defined for model"-error quick & easy. I'll also explain why the error in Laravel exists.
-
PHP for-loop for beginners – with examples and advanced uses (2022)
In this tutorial I'll show you how the for-loop in PHP works and give you examples of how to use the for-loop. I'll also show you several advanced techniques.
-
How to send e-mails in Laravel with Tailwind CSS
In this tutorial I'll show you how to send e-mails from Laravel with Tailwind CSS. I'll learn you how to set this up and how to inline the Tailwind CSS in e-mails.
-
How to use Stripe CLI with Laravel Valet to listen for events
In this tutorial I'll show you how to use the Stripe CLI with Laravel Valet, so that you can listen to events and forward Stripe webhooks to your local application.
-
New package: A package to handle the SEO in any Laravel-application
In this article I'll introduce a new package called Laravel SEO. This package will help you set up SEO in your Laravel application, by providing sensible defaults, but still allowing you to extend the package.
-
How to mock the Laravel Application instance
In this article I'll show you how to easily mock calls to the Laravel-application instance. I'll show you the best way to mock calls to app() by using a facade.
-
How to use different Tailwind CSS configs with Laravel Mix
In this tutorial I'll show you how to use Tailwind CSS with multiple different configuration files with Laravel Mix & PostCSS.
-
Website redesign ⚡️
In March 2022 I redesigned my website and moved everything from WordPress to Laravel. In this blog post I share some of the tech stack and a few screenshots of both sites.
-
How to remove the 'generated from' message on GitHub
In this article I'll show you how to remove the 'generated from' message on GitHub repositories, that were generated from a template repository.
-
How to mock dependencies in Laravel (Full 2022 Guide for beginners)
In this article I'll show you how to mock dependencies in Laravel and use Mockery in your tests. After reading you'll be ready to start mocking your app!
-
A fluent filesystem package for PHP (New package⚡️)
This article will show you how to use my new package to edit and modify files, directories and namespaces in your PHP or Laravel project in a fluent way.
-
How to use Pest PHP with Laravel – Full Guide (2023)
In this article I'll show you the basics of testing with Pest. This article is great for everyone who is looking to start testing or who wants to switch to Pest.
-
Automated installation of the TALL-stack (new package)⚡️
In this article I'll show you my new Laravel package to automate the process of installing the TALL-stack. It speeds up development time and has handy features.
-
How to test custom PHPUnit assertions & helpers
In this article I'll show you how to test your own custom testing assertions for PHPUnit, so that you can test your code with ease.
-
Celebrating the first year of ralphjsmit.com 🥳
In this blogpost I'll look back at the first year of ralphjsmit.com and the statistics from Google.
-
2021 – year in review
In this article I'll look back at the year 2021.
2021.
39 articles-
Great new PHP 8.1 features: enums, readonly & more (2021)
In this article I'll show you the latest PHP 8.1 features with easy examples, like enums, readonly properties, callables, array unpacking with string keys and more.
-
Laravel Livewire for Beginners – Full 2021 Guide
In this tutorial I'll explain you how to get started with Laravel Livewire as a beginner, describing the most important features and giving examples.
-
How to test Laravel notification e-mail contents
In this tutorial I'll show you two ways how to test the contents of a Laravel notification, by using Feature tests and Unit tests.
-
Test how many times a Laravel Notification was sent
In this article I'll show you how to test whether a notification has been sent a specific number of times in Laravel, by using the Laravel Notification facade.
-
How to keep Laravel Horizon active with a cron job (New package)
In this tutorial I'll show you the fast and easy alternative I've made to replace Supervisor in a Laravel Horizon queue. Laravel Horizon will be restarted if needed.
-
Laravel Eloquent relationships for beginners - Full 2023 Guide
In this tutorial I'll explain you how to use the most common Eloquent relationships, so that you are up and running quickly with Eloquent relationships.
-
How to manage DateTime with Carbon in Laravel & PHP
In this tutorial I'll explain you how to manage dates and times with Carbon in Laravel and PHP. I'll show you how to calculate datetime differences and display them in a human-readable way.
-
Laravel Eloquent for Beginners | Full guide (2021)
Laravel Eloquent is a great way to work with databases. In this beginners tutorial I'll show you how to use Laravel Eloquent, so that you're quickly up-and-running with Eloquent.
-
Laravel Databases & Migrations for Beginners (2021)
In this tutorial I'll show you how to use databases and migrations in Laravel. If you're a beginner, this is the perfect tutorial about databases and migrations.
-
How to solve Composer PHP memory exhausted issue in 30 seconds (2021)
In this tutorial I'll show you how to fix the PHP Composer 'Allowed memory size of X bytes exhausted' issue. We'll do this by setting the PHP memory to unlimited and creating an alias for it.
-
How to use Browsersync with Laravel Valet (2021)
In this tutorial I'll show you how to install and Browsersync with Laravel Valet with https://. I'll show you two methods to do so: with Laravel Mix and with NPM.
-
How to validate Laravel user input for beginners (2021)
In this article I'll show you the three ways for user input Validation in Laravel: from directly using Validate() on the request, to Form Requests and manually making the Validator.
-
How to use Tailwind CSS v2.1 JIT compiler with WordPress theme (2021)
In this tutorial I'll show you how to create a WordPress theme from scratch and how to install and use Tailwind CSS. I'll demonstrate how to enable the JIT compiler and how to watch for file changes to regenerate CSS automatically.
-
How to rollback the latest Laravel database migration(s)
In this article I'll show you how to rollback or undo the latest Laravel database migration in less than a minute. It uses the official php artisan command, provided by Laravel.
-
How to apply .gitignore to an existing Git repository
In this tutorial I'll show you how to apply changes/updates in your .gitignore file to an existing Git repository – in less than a minute. Works with GitHub, Bitbucket, GitLab & any other provider.
-
How to uninstall Homebrew on macOS – Full Guide (2021)
In this tutorial I'll show you how to uninstall Homebrew on macOS and which files you'll need to cleanup afterwards, so that Homebrew is fully removed.
-
How to install Homebrew on macOS – Full guide (2021)
In this tutorial I'll show you how to install Homebrew on macOS (2021). I'll also discuss what steps to take after installation and how to disable Brew analytics.
-
How to switch between Node.js versions with Homebrew (2021)
In this tutorial I'll show you the easiest way to switch between Node.js versions on macOS. To do so, we'll use the Homebrew package manager and install and configure it.
-
How to download your deployed Netlify builds
In this tutorial I'll show you how to download a deployed build from Netlify to your own computer, so you can easily inspect the result.
-
How to use GitHub Actions with webhooks & API endpoints
In this tutorial I'll show how you can call API-endpoints and webhooks straight from GitHub Actions. You can trigger other services from GitHub Actions with curl.
-
How to check your Laravel database connection
Learn how to check if, and if so, which database your Laravel application is connected to. Display this on the front-end or use the php artisan dump-server to log it.
-
How to use Tailwind CSS v2.1 JIT compiler with Laravel Mix
In this tutorial I'll show you how to use the Tailwind CSS v2.1 JIT-compiler with Laravel Mix. We'll setup Tailwind CSS and the JIT-compiler to compile CSS.
-
How to use DBngin & TablePlus for local development
Learn how to use DBngin to set up local MySQL, PostgreSQL and Redis databases on your Mac. I'll explain which credentials to use and how to create databases.
-
How to allow only positive integers in HTML number input elements
In this article I'll explain how to make sure that HTML number inputs only accept positive integers. The default behaviour allows users to use negative numbers and even text.
-
How to combine structured data into one script tag
You can add structured data to your website by using script tags. In this tutorial, I'll explain how to combine multiple schemes into one script tag, to prevent unnecessary script tags.
-
Install Tailwind CSS & SASS with Laravel Mix (2022)
In this tutorial I'll show you how to set up a new Laravel application with Tailwind CSS and SASS (SCSS) by using the Laravel Mix webpack compiler package.
-
How to bulk move multiple files with GitHub Desktop
In this tutorial I'll show you how to move multiple files in bulk on GitHub. To do so, we'll use the handy GitHub Desktop app to commit the changes.
-
How to fix Laravel command not found on macOS for bash/zsh
In this tutorial I'll show you how to fix the "Laravel command not found" error on bash/zsh. We'll configure the command, so that you can quickly get started!
-
How to define the $query parameter for Elementor
In this tutorial I'll show you how the $query parameter in the Elementor Page Builder for WordPress works. You can use this to add custom CSS to Elementor.
-
Automatic WordPress update mechanism with GitHub Updater
In this tutorial I'll show you how to add an automatic update mechanism to your custom WordPress-plugin and themes, by using the GitHub Updater plugin.
-
How to check whether the Elementor editor is active
In this tutorial I'll show you how to check in WordPress whether the Elementor page builder is used on a page, so you can show or hide things when editing the page.
-
How to use the Kirki typography control: custom fonts & Google
This guide describes the whole process on adding the Kirki typography control and how to add custom fonts to it. It features examples and offers an explanation of all the options.
-
Site performance: the first two months in Google
In this article I'll show you to site performance of my website in the first two months on Google.
-
How to unfork a GitHub repository (2023 official method)
In this tutorial I'll show you the official way to unfork a repository in GitHub in 2022. This is also known as detaching or extracting a GitHub repository.
-
Check whether a Gravatar exists for a specific e-mail
In this tutorial I'll show how you can check whether there exists a Gravatar for a specific e-mailaddress in PHP.
-
Automatically add anchor links to Gutenberg headings
This article explains how to automatically add anchor links to headings generated by Gutenberg. This is very useful if you need to link to specific sections in an article.
-
Create a custom cursor with CSS effects in iPadOS style
Learn how to create a custom cursor with simple CSS and JavaScript. Animate the new cursor and give your website instantly a premium look and feel!
-
Create a category dropdown in WordPress customizer
In this tutorial I'll show you how to create a category dropdown in the WordPress customizer, so that users can choose a specific category in the customizer.
-
How to output custom HTML for WordPress comments
Learn how to output custom HTML for the comments section in WordPress. We'll use our own function to retrieve and place the information on the correct places in your own HTML.
2020.
10 articles-
How to exclude subdomains from WordPress Multisite
Learn how to exclude subdomains from the default WordPress Multisite and use your own files instead. Excluding a subdomain is done via the .htaccess file.
-
How to use the Elementor Stylesheet::add_rules
In this tutorial I'll show you how to add custom CSS to the stylesheet of the WordPress Elementor pagebuilder. Handy when you're building a WordPress theme.
-
Overview of the_content: Gutenberg & Elementor
Learn how the WordPress the_content() function exactly works and how it relates to pagebuilders like Elementor and Visual Composer. Explained for beginners.
-
How to add icons to customizer panels and sections
The WordPress customizer can become a bit uncluttered with a huge amount of panes and fields. Adding icons to panels and sections increases the user experience.
-
How to clean up WP head-tag and improve pagespeed (2022 guide)
In this tutorial I'll show you how to optimize the head-tag on your WordPress-website. This will increase your pagespeed and you'll only the minimum nr. of assets.
-
Conditionally output CSS from the customizer
Learn how to conditionally output CSS from the WordPress Customizer with the Kirki framework. Discover CSS output conditions work with illustrative examples.
-
Beginners guide for the Kirki customizer framework
Learn how to install, configure and use the Kirki framework with your theme and rapidly built advanced controls and settings for the WordPress customizer.
-
How to use TGM Plugin Activation – Full beginner's guide (2021)
Do you have no idea how to use the TGM Plugin Activation library to require plugins for your WordPress theme? Learn how to use TGMPA with any theme.
-
8 reasons to use Kirki as theme developer
Making a WordPress theme customizer-ready can take a lot of time. Kirki saves you heaps of time by offering 30+ customizer controls out of the box. A complete toolkit for WordPress theme Developers.
-
How to integrate Elementor in a WordPress theme
Learn how to integrate the Elementor Page Builder in any WordPress theme. Learn how to seamlessly integrate Elementor in any theme with a few simple steps.