PHPackages                             bee-b/markdown - 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. [Framework](/categories/framework)
4. /
5. bee-b/markdown

ActiveLibrary[Framework](/categories/framework)

bee-b/markdown
==============

Markdown Is A CommonMark Wrapper For Laravel

v13.1.2(4y ago)07MITPHPPHP ^7.2.5 || ^8.0

Since Dec 10Pushed 4y agoCompare

[ Source](https://github.com/bee-b/Laravel-Markdown)[ Packagist](https://packagist.org/packages/bee-b/markdown)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ Fund](https://tidelift.com/funding/github/packagist/graham-campbell/markdown)[ RSS](/packages/bee-b-markdown/feed)WikiDiscussions 13.1 Synced 3w ago

READMEChangelog (1)Dependencies (9)Versions (61)Used By (0)

Laravel Markdown
================

[](#laravel-markdown)

Laravel Markdown was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is a [CommonMark](https://github.com/thephpleague/commonmark) wrapper for [Laravel](http://laravel.com). It ships with **integration with Laravel's view system** too. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Laravel-Markdown/releases), [security policy](https://github.com/GrahamCampbell/Laravel-Markdown/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).

[![Banner](https://user-images.githubusercontent.com/2829600/71477505-680d0f80-27e2-11ea-94a6-b4bacb08e270.png)](https://user-images.githubusercontent.com/2829600/71477505-680d0f80-27e2-11ea-94a6-b4bacb08e270.png)

[![Promo Banner](https://camo.githubusercontent.com/3ecdeec02df25313edab38bf5a85c70bbf9cbf016cba318a475b8499fe6e95b4/68747470733a2f2f7873636f64652e636f6d2f6173736574732f70726f6d6f2d62616e6e65722e737667)](https://xscode.com/grahamcampbell/Laravel-Markdown)

[![Build Status](https://camo.githubusercontent.com/4be397930c74aaa1aff05b181a746dbbcadb0ab81289709cbd0f3fd2aefcadd5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f47726168616d43616d7062656c6c2f4c61726176656c2d4d61726b646f776e2f54657374733f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-Markdown/actions?query=workflow%3ATests)[![StyleCI Status](https://camo.githubusercontent.com/24bdbe6d3d51f73e34f48b2c1c224208579b7946e2e4a9807dce687232dffa1a/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f31353039303638372f736869656c64)](https://github.styleci.io/repos/15090687)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Downloads](https://camo.githubusercontent.com/aed17e72e0f124d7beb44db8e5c4362bea0559ec159c7951296a5aeb6a5cb23a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67726168616d2d63616d7062656c6c2f6d61726b646f776e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graham-campbell/markdown)[![Latest Version](https://camo.githubusercontent.com/740f2510189a3862caf84432f6a3af8fadb23b9fb68be781fcd90860b744ed87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f47726168616d43616d7062656c6c2f4c61726176656c2d4d61726b646f776e3f7374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-Markdown/releases)

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

[](#installation)

Laravel Markdown requires [PHP](https://php.net) 7.2-8.0. This particular version supports Laravel 6-8.

MarkdownL5.1L5.2L5.3L5.4L5.5L5.6L5.7L5.8L6L7L85.3✅✅❌❌❌❌❌❌❌❌❌6.1✅✅✅❌❌❌❌❌❌❌❌7.1✅✅✅✅❌❌❌❌❌❌❌8.1✅✅✅✅✅❌❌❌❌❌❌9.0✅✅✅✅✅❌❌❌❌❌❌10.3❌❌❌❌✅✅✅✅❌❌❌11.2❌❌❌❌✅✅✅✅✅✅❌12.0❌❌❌❌❌❌❌❌✅✅❌13.1❌❌❌❌❌❌❌❌✅✅✅To get the latest version, simply require the project using [Composer](https://getcomposer.org):

```
$ composer require graham-campbell/markdown:^13.1
```

Once installed, if you are not using automatic package discovery, then you need to register the `GrahamCampbell\Markdown\MarkdownServiceProvider` service provider in your `config/app.php`.

You can also optionally alias our facade:

```
        'Markdown' => GrahamCampbell\Markdown\Facades\Markdown::class,
```

Configuration
-------------

[](#configuration)

Laravel Markdown supports optional configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/markdown.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are several config options:

##### Enable View Integration

[](#enable-view-integration)

This option (`'views'`) specifies if the view integration is enabled so you can write markdown views and have them rendered as html. The following extensions are currently supported: `'.md'`, `'.md.php'`, and `'.md.blade.php'`. Additionally, this will enable the `@markdown` Blade directive. You may disable this integration if it is conflicting with another package. The default value for this setting is `true`.

##### CommonMark Extensions

[](#commonmark-extensions)

This option (`'extensions'`) specifies what extensions will be automatically enabled. Simply provide your extension class names here, and they will be resolved from the service container, and registered with CommonMark. The default value for this setting is `[]`.

##### Renderer Configuration

[](#renderer-configuration)

This option (`'renderer'`) specifies an array of options for rendering HTML. The default value for this setting is `['block_separator' => "\n", 'inner_separator' => "\n", 'soft_break' => "\n"]`.

##### Enable Em Tag Parsing

[](#enable-em-tag-parsing)

This option (`'enable_em'`) specifies if `` parsing is enabled. The default value for this setting is `true`.

##### Enable Strong Tag Parsing

[](#enable-strong-tag-parsing)

This option (`'enable_strong'`) specifies if `` parsing is enabled. The default value for this setting is `true`.

##### Enable Asterisk Parsing

[](#enable-asterisk-parsing)

This option (`'use_asterisk'`) specifies if `*` should be parsed for emphasis. The default value for this setting is `true`.

##### Enable Underscore Parsing

[](#enable-underscore-parsing)

This option (`'use_underscore'`) specifies if `_` should be parsed for emphasis. The default value for this setting is `true`.

##### HTML Input

[](#html-input)

This option (`'html_input'`) specifies how to handle untrusted HTML input. The default value for this setting is `'strip'`.

##### Allow Unsafe Links

[](#allow-unsafe-links)

This option (`'allow_unsafe_links'`) specifies whether to allow risky image URLs and links. The default value for this setting is `true`.

##### Maximum Nesting Level

[](#maximum-nesting-level)

This option (`'max_nesting_level'`) specifies the maximum permitted block nesting level. The default value for this setting is `INF`.

Usage
-----

[](#usage)

##### Facades\\Markdown

[](#facadesmarkdown)

This facade will dynamically pass static method calls to the `'markdown'` object in the ioc container which by default is an instance of `League\CommonMark\MarkdownConverterInterface`.

##### MarkdownServiceProvider

[](#markdownserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

##### Real Examples

[](#real-examples)

Here you can see an example of just how simple this package is to use.

```
use GrahamCampbell\Markdown\Facades\Markdown;

Markdown::convertToHtml('foo'); // foo
```

If you prefer to use dependency injection over facades like me, then you can easily inject the class like so:

```
use Illuminate\Support\Facades\App;
use League\CommonMark\MarkdownConverterInterface;

class Foo
{
    protected $converter;

    public function __construct(MarkdownConverterInterface $converter)
    {
        $this->converter = $converter;
    }

    public function bar()
    {
        return $this->converter->convertToHtml('foo');
    }
}

App::make('Foo')->bar();
```

And don't forget, that's just the basics. We also support extension through listening for the resolving event from the container, and we ship with integration with Laravel's view system. You can use both the `@markdown` blade directive, and also using the following file extensions will compile your views as markdown: `'.md'`, `'.md.php'`, and `'.md.blade.php'`.

For example, the following are all methods of rendering markdown:

*`foo.blade.php`*:

```
@markdown('# Foo')
```

*`bar.blade.php`*:

```
@markdown
# Bar
@endmarkdown
```

*`baz1.md`*:

```
# Baz 1

```

*`baz2.md.php`*:

```
# Baz 2

```

*`baz3.md.blade.php`*:

```
# Baz 3

```

##### Further Information

[](#further-information)

There are other classes in this package that are not documented here (such as the engine and compiler classes). This is because they are not intended for public use and are used internally by this package.

### Extensions

[](#extensions)

As hinted in the configuration docs, CommonMark can be modified using extensions. There are some very good examples in the customization section of the CommonMark docs for how to create custom parsers and renders in the customization section: .

The Smart Punctuation package also serves as a good example of how to implement the full deal: . In particular, note the presence of the [Extension class](https://github.com/thephpleague/commonmark-ext-smartpunct/blob/v1.1.0/src/SmartPunctExtension.php), and the fact that you can add it to the extensions array in your `app/config/markdown.php` file. If you don't see the file in your config folder, you would need to run `php artisan vendor:publish`.

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to Graham Campbell at . All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/GrahamCampbell/Laravel-Markdown/security/policy).

License
-------

[](#license)

Laravel Markdown is licensed under [The MIT License (MIT)](LICENSE).

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of `graham-campbell/markdown` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-graham-campbell-markdown?utm_source=packagist-graham-campbell-markdown&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.1% 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.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~97 days

Total

61

Last Release

1756d ago

Major Versions

v11.2.0 → v12.0.02020-03-01

v11.2.1 → v12.0.12020-04-14

v12.0.2 → v13.0.02020-07-14

11.2.x-dev → 12.0.x-dev2020-07-14

12.0.x-dev → v13.1.02020-08-14

PHP version history (7 changes)v0.1.0-alphaPHP &gt;=5.3.3

v1.0.0-beta1PHP &gt;=5.4.7

v3.1.0PHP &gt;=5.5.9

v8.0.0PHP ^7.0

v10.0.0PHP ^7.1.3

v12.0.0PHP ^7.2.5

v13.1.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/89344012?v=4)[bee-b](/maintainers/bee-b)[@bee-b](https://github.com/bee-b)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (396 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (2 commits)")[![bee-b](https://avatars.githubusercontent.com/u/89344012?v=4)](https://github.com/bee-b "bee-b (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![mmachatschek](https://avatars.githubusercontent.com/u/10237069?v=4)](https://github.com/mmachatschek "mmachatschek (1 commits)")[![nazar-pc](https://avatars.githubusercontent.com/u/928965?v=4)](https://github.com/nazar-pc "nazar-pc (1 commits)")[![tevfik6](https://avatars.githubusercontent.com/u/1277211?v=4)](https://github.com/tevfik6 "tevfik6 (1 commits)")[![aidabeorn](https://avatars.githubusercontent.com/u/219796?v=4)](https://github.com/aidabeorn "aidabeorn (1 commits)")[![vaughany](https://avatars.githubusercontent.com/u/381767?v=4)](https://github.com/vaughany "vaughany (1 commits)")[![bbashy](https://avatars.githubusercontent.com/u/1149200?v=4)](https://github.com/bbashy "bbashy (1 commits)")[![danhunsaker](https://avatars.githubusercontent.com/u/1534396?v=4)](https://github.com/danhunsaker "danhunsaker (1 commits)")

---

Tags

frameworklaravelmarkdownGraham CampbellGrahamCampbellcommonmarkLaravel-Markdowncommon mark

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bee-b-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/bee-b-markdown/health.svg)](https://phpackages.com/packages/bee-b-markdown)
```

###  Alternatives

[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.5M65](/packages/graham-campbell-markdown)[moonshine/moonshine

Laravel administration panel

1.3k253.1k79](/packages/moonshine-moonshine)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M186](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/folio

Page based routing for Laravel.

603583.7k32](/packages/laravel-folio)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M129](/packages/laravel-pulse)

PHPackages © 2026

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