DC Blog RSS Feed https://dcblog.dev DC Blog RSS Feed EN 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
My process for writing Laravel packages https://dcblog.dev/my-process-for-writing-laravel-packages

In this post, I go over the overall steps to creating a package.

]]>
https://dcblog.dev/my-process-for-writing-laravel-packages Fri, 10 Nov 2023 02:13:00 GMT
Running HTTP requests in PhpStorm https://dcblog.dev/running-http-requests-in-phpstorm

Running API tests you may be tempted to open PostMan or another API client, did you know, you can run HTTP requests from inside PhpStorm directly?

]]>
https://dcblog.dev/running-http-requests-in-phpstorm Tue, 10 Oct 2023 11:07:00 GMT
Extracting a time into select menus with PHP https://dcblog.dev/extracting-a-time-into-select-menus-with-php

When storing time in a database, often I'll store this in a time format such as 14:25:00 When populating this in a form I'll either use a time picker or use a plain select menu a separate menu for each element.

]]>
https://dcblog.dev/extracting-a-time-into-select-menus-with-php Fri, 06 Oct 2023 11:04:00 GMT
Vue show and hide form elements https://dcblog.dev/vue-show-and-hide-form-elements

When working with forms, it is common to display or conceal various fields based on the options selected.

]]>
https://dcblog.dev/vue-show-and-hide-form-elements Wed, 04 Oct 2023 11:03:00 GMT
My PhpStorm Setup https://dcblog.dev/my-phpstorm-setup

I've documented my PhpStorm setup, what theme I use, plugins, and keybindings.

]]>
https://dcblog.dev/my-phpstorm-setup Wed, 20 Sep 2023 05:31:00 GMT