PHPackages                             mprince/laravel-mdparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mprince/laravel-mdparser

ActiveMetapackage[Utility &amp; Helpers](/categories/utility)

mprince/laravel-mdparser
========================

Laravel markdown parser

03PHP

Since Jan 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mprince2k18/laravel-mdparser)[ Packagist](https://packagist.org/packages/mprince/laravel-mdparser)[ RSS](/packages/mprince-laravel-mdparser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel-MDPARSER
================

[](#laravel-mdparser)

[![Build Status](https://camo.githubusercontent.com/cc4eae0d5d4bc90c350ff34769277643ad8d818a43e1cb6cd0d674d37c91867f/68747470733a2f2f7472617669732d63692e6f72672f6d7072696e63652f6c61726176656c2d6d647061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mprince/laravel-mdparser)

A small, lightweight and easy-to-use Laravel package for handling markdown. It comes with a facade, a helper function and a Blade directive to make life easier for you.

Installation
------------

[](#installation)

To install it, simply pull it down with Composer. Run the `php artisan vendor:publish` command to publish the configuration file.

```
composer require mprince/laravel-mdparser

```

Laravel 9 and above use Package Auto-Discovery, so you do not have to manually add the MarkdownServiceProvider.

Usage
-----

[](#usage)

### Blade-directive

[](#blade-directive)

The markdown parser may be used in your Blade templates by using the `@markdown` directive.

```

    {{ $post->title }}

        @markdown($post->body)

```

You can also use a block-style syntax:

```
@markdown
# Hello world

This *text* will be **parsed** to [HTML](http://laravel.com).
@endmarkdown
```

### Facade

[](#facade)

If you registered the Markdown facade as shown above, you can easily parse markdown using it.

```
$markdown = "# Hello";

$html = Markdown::parse($markdown) // Hello
```

### Helper-functions

[](#helper-functions)

```
$html = markdown('# Hello'); // Hello
```

```
$html = markdown_capture(function () {
    echo "# Hello";
    echo "\n\n";
    echo "So **cool**!"
});

// Hello
// So cool!
```

---

Of course, you could also resolve the parser from the service container and use it yourself.

```
$parser = app('Mprince\Markdown\Parser');
$html = $parser->parse('# Hello'); // Hello
```

### Drivers (NEW!)

[](#drivers-new)

Laravel-Markdown allows you to add custom markdown drivers. In order to use a custom markdown driver, you need to create a class that implements the `Mprince\Markdown\Drivers\MarkdownDriver` interface. The interface contains two methods: `text` and `line`. `text` is used to convert a block of markdown to HTML, while `line` is used to convert a single line.

Laravel-Markdown ships with a `ParsedownDriver` using the [Parsedown-package](http://parsedown.org/) by @erusev.

Credits
-------

[](#credits)

- Mohamed Said [(@themsaid)](https://github.com/themsaid)

License
-------

[](#license)

Licensed under MIT. For more information, see the [LICENSE-file](https://github.com/mprince/laravel-mdparser/blob/master/LICENSE).

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43857625?v=4)[Mohammad Prince](/maintainers/mprince2k18)[@mprince2k18](https://github.com/mprince2k18)

---

Top Contributors

[![mprince2k18](https://avatars.githubusercontent.com/u/43857625?v=4)](https://github.com/mprince2k18 "mprince2k18 (3 commits)")

### Embed Badge

![Health badge](/badges/mprince-laravel-mdparser/health.svg)

```
[![Health](https://phpackages.com/badges/mprince-laravel-mdparser/health.svg)](https://phpackages.com/packages/mprince-laravel-mdparser)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
