RSSAmplifier

Blog

David Carr's Blog

David Carr's Blog Posts

dcblog.devRSS feed ↗20 posts

Latest posts

New Feature: Data Anonymization in Laravel DB Sync

Syncing production data to local/staging just got safer!

Supercharge Laravel with Junie and PhpStorm Integration

I’m always looking for ways to work more efficiently. Here’s how **Junie**, an AI assistant, and my Laravel integration package **laravel-junie** for PhpStorm have helped simplify my workflow.

Upgrading Code Quality with Laravel Pint using custom rules

In this post, we’ll walk through our tailored `pint.json` configuration — explain what we changed, why we changed it, and how it helps us write cleaner, safer, and more maintainable PHP code.

Introducing Laravel Junie: Streamline Junie Guideline Integration in Laravel

Laravel developers often seek tools that enhance productivity and maintain code consistency. The newly released **Laravel Junie** package addresses this need by simplifying the integration of PhpStorm s Junie guideline documents into Laravel projects.

Implementing a Dark Mode Toggle in Laravel with Tailwind CSS 4

TailwindCSS 4 out the box supports prefers-color-scheme CSS media feature, I want class based dark mode support

Consistent API error handling in Laravel

In API development, providing clear and structured error responses is crucial for a seamless developer experience. This blog post explores a custom exception handling approach that ensures consistent JSON error responses, making it easier for API consumers to handle errors efficiently.

Effortlessly Trigger Modals with Session Flash in Laravel

Here’s a dead simple way of triggering a model to show or anything really from a controller…

List your Laravel Herd projects on localhost

When developing with **Laravel Herd**, managing multiple projects can sometimes feel overwhelming. Wouldn’t it be great to have a sleek way to list all your parked projects directly from localhost?

How to get a docker container id

To get the Docker container ID, you can use the docker ps command, which lists all running containers along with their container IDs. Below are different methods to retrieve the container ID

Mastering PHPStan: Common Errors and How to Fix Them

PHPStan is a static analysis tool for PHP that focuses on finding bugs in your code without actually running it. By analyzing your codebase, PHPStan can detect potential issues such as type errors, undefined variables, and incorrect method calls, among others. It helps developers maintain high code quality and adhere to best practices by providing detailed feedback and suggestions for improvement.…

Git Stashing Explained

When working on a project, you might find yourself in a situation where you need to switch branches or pull updates from a remote repository, but you have uncommitted changes that you don t want to lose. This is where Git s stashing feature comes in handy. Stashing allows you to temporarily save your changes without committing them, so you can work on something else and come back to your changes…

Enhance Your Web Applications with These Livewire UI Kits

Are you looking to enhance your Laravel Livewire projects with top-notch UI components? Look no further! In this article, we explore some of the best Livewire UI kits available, each designed to streamline your development process and elevate your web applications.

Mocking Stripe in Laravel with Stripe Mock Server

If you ve ever tried to test your Stripe integration, you ll know how challenging it can be. The Stripe SDK uses lots of static methods that are hard to fake. I would rather not write my own stubs or dummy classes that get switched out in tests, that s a lot of work. thankfully, Stripe has a [Mock Server](https://github.com/stripe/stripe-mock) that you can install. The idea is you use Stripe s API…

How to Organize Composer Scripts Effectively

A composer script is a set of custom commands defined in a `composer.json` file. It lets you automate tasks like running tests, performing analysis, or managing dependencies in a PHP project. This allows you to create a shortcut to run the scripts, as long as they are installed by the project.

Toggle classes from your markup in PhpStorm and VSCode

Working with TailwindCSS will result in a lot of classes being added to your HTML. This can at times make it hard to read the markup.

How to toggle a mobile menu with Tailwind and AlpineJS

Making a mobile and desktop menu is something that is super simple to do with Tailwind and AlpineJS. A typical navbar will contain a series of links styled with Tailwind, it s possible to apply different styles depending on the browser size for mobile and desktop, but to me it s far simpler to have 2 divs in your HTML. A div for mobile and one for desktop.

Customize Your Hashnode Blog Frontend with Headless Frontend and Laravel

The first focus is using [Hashnode s API](https://hashnode.com/headless) to pull in your posts and pages into a Laravel application when using headless within your blog advanced settings page.

PHP use an enum for Filters

I have a class that allows filtering based on an option, I need a way to accept options and also reject invalid options.

Composer Scripts: Boosting Your Team's Efficiency

Hey there! Today, we re diving into the world of Composer scripts and exploring their untapped potential. If you re part of the Laravel community or work with PHP, you re likely familiar with the plethora of out-of-the-box scripts you get when you install Laravel. These are incredibly handy in reacting to various events during development. But here s something you may not know—you can brew your…

How to disable Laravel console commands

Suppose you find yourself in a situation where you need to disable or intercept a console command in Laravel. This tutorial will primarily focus on how to intercept the `php artisan migrate` command. We ll delve into the command method `app/Console/Kernel.php` and explore how to prevent the migrate command from executing any actions.