DC Blog RSS Feed https://dcblog.dev DC Blog RSS Feed EN List your Laravel Herd projects on localhost https://dcblog.dev/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?]]> https://dcblog.dev/list-your-laravel-herd-projects-on-localhost Sat, 21 Dec 2024 09:36:00 GMT How to get a docker container id https://dcblog.dev/how-to-get-a-docker-container-id https://dcblog.dev/how-to-get-a-docker-container-id Mon, 09 Dec 2024 04:45:00 GMT Mastering PHPStan: Common Errors and How to Fix Them https://dcblog.dev/mastering-phpstan-common-errors-and-how-to-fix-them https://dcblog.dev/mastering-phpstan-common-errors-and-how-to-fix-them Sat, 07 Sep 2024 01:16:00 GMT Git Stashing Explained https://dcblog.dev/git-stashing-explained https://dcblog.dev/git-stashing-explained Fri, 30 Aug 2024 01:13:00 GMT Enhance Your Web Applications with These Livewire UI Kits https://dcblog.dev/enhance-your-web-applications-with-these-livewire-ui-kits https://dcblog.dev/enhance-your-web-applications-with-these-livewire-ui-kits Fri, 30 Aug 2024 01:09:00 GMT Mocking Stripe in Laravel with Stripe Mock Server https://dcblog.dev/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 endpoints in your application, and when tests run, they run using the Stripe Mock server endpoints and return a sample response from Stripe for each endpoint.]]> https://dcblog.dev/mocking-stripe-in-laravel-with-stripe-mock-server Mon, 26 Aug 2024 04:25:00 GMT How to Organize Composer Scripts Effectively https://dcblog.dev/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.]]> https://dcblog.dev/how-to-organize-composer-scripts-effectively Wed, 14 Aug 2024 05:13:00 GMT Toggle classes from your markup in PhpStorm and VSCode https://dcblog.dev/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.]]> https://dcblog.dev/toggle-classes-from-your-markup-in-phpstorm-and-vscode Wed, 14 Aug 2024 05:09:00 GMT How to toggle a mobile menu with Tailwind and AlpineJS https://dcblog.dev/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.]]> https://dcblog.dev/how-to-toggle-a-mobile-menu-with-tailwind-and-alpinejs Sat, 08 Jun 2024 01:38:00 GMT Customize Your Hashnode Blog Frontend with Headless Frontend and Laravel https://dcblog.dev/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.]]> https://dcblog.dev/customize-your-hashnode-blog-frontend-with-headless-frontend-and-laravel Mon, 27 May 2024 01:10:00 GMT PHP use an enum for Filters https://dcblog.dev/php-use-an-enum-for-filters https://dcblog.dev/php-use-an-enum-for-filters Fri, 03 May 2024 10:51:00 GMT Composer Scripts: Boosting Your Team's Efficiency https://dcblog.dev/composer-scripts-boosting-your-teams-efficiency https://dcblog.dev/composer-scripts-boosting-your-teams-efficiency Fri, 12 Apr 2024 11:26:00 GMT How to disable Laravel console commands https://dcblog.dev/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.]]> https://dcblog.dev/how-to-disable-laravel-console-commands Mon, 05 Feb 2024 11:49:00 GMT 15 years of blogging 500 posts later https://dcblog.dev/15-years-of-blogging-500-posts-later You know, it's funny how the big milestones can sneak up on us.]]> https://dcblog.dev/15-years-of-blogging-500-posts-later Mon, 05 Feb 2024 11:30:00 GMT GitHub patch release previous version https://dcblog.dev/github-patch-release-previous-version

On Github you way from time to time need to patch release the previous version of a published release.

]]>
https://dcblog.dev/github-patch-release-previous-version Fri, 02 Feb 2024 03:37:00 GMT
The podcasts I listen to as a PHP developer https://dcblog.dev/the-podcasts-i-listen-to-as-a-php-developer

The following are the podcasts I listen to. In no particular order. (That have episodes recently)

]]>
https://dcblog.dev/the-podcasts-i-listen-to-as-a-php-developer Fri, 19 Jan 2024 02:47:00 GMT
Creating Flexible Layouts in Laravel with Yields, Includes and Slots https://dcblog.dev/creating-flexible-layouts-in-laravel-with-yields-includes-and-slots

In Laravel, the @yield directive is used in blade templates to define a section that can have code injected or "yielded" by child views.

]]>
https://dcblog.dev/creating-flexible-layouts-in-laravel-with-yields-includes-and-slots Thu, 18 Jan 2024 02:41:00 GMT
Enhancing Laravel Applications with Traits: A Step-by-Step Guide https://dcblog.dev/enhancing-laravel-applications-with-traits-a-step-by-step-guide

Traits are a mechanism for code reuse. Traits allow you to create methods that can be used in multiple classes to avoid code duplication. They are intended to enhance traditional inheritance, enabling you to reuse sets of methods freely in several independent classes living in different class hierarchies.

]]>
https://dcblog.dev/enhancing-laravel-applications-with-traits-a-step-by-step-guide Wed, 17 Jan 2024 02:21:00 GMT
Laravel ApiResouce name nested route placeholder https://dcblog.dev/laravel-apiresouce-name-nested-route-placeholder

When using an ApiResource that has more than one placeholder it may seem tricky to figure out how to name the placeholder used.

]]>
https://dcblog.dev/laravel-apiresouce-name-nested-route-placeholder Thu, 11 Jan 2024 02:14:00 GMT
Black Friday Sale on Laravel:The Modular Way https://dcblog.dev/black-friday-sale-on-laravelthe-modular-way

Dive into the world of #LaravelModules like never before!

]]>
https://dcblog.dev/black-friday-sale-on-laravelthe-modular-way Wed, 22 Nov 2023 02:12:00 GMT