Category: PHP


New Package: Laravel CommonMark

I bit the bullet, and tried something I haven’t done before. Today I’ve released my first open-source package, ever.

Introducing Laravel CommonMark, a Laravel wrapper for league/commonmark. Laravel CommonMark can parse Markdown from your blade templates into HTML, or parsed inline by calling the provided helper function.

Usage is fairly simple; from within your Laravel application, simply require the package:

$ composer require harrk/laravel-commonmark

Create a new blade view with the .md.blade.php extension (instead of .blade.php) and any Markdown will be rendered as HTML automatically.

This package requires Laravel 5.6 and PHP 7.1.3 (or greater).

The source code and further information can be found on GitHub,


Laravel: Extending Models With Existing Relationships

Extending a model in Laravel can cause complications with existing relationships. I’ll use a User model for this example with a bunch of existing relationships to other models, like permissions or...


Laravel Cashier: Using default card as subscription payment

I’ve been busy implementing a subscription service for one of my projects. As it’s using Laravel I’ve been able to use Cashier for much of the scaffolding around Stripe payments. In...