Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

laravel-markdown

> 后端框架
Open source

A small, lightweight and easy-to-use Laravel package for handling markdown.

183 stars0 likes2 views
WebsiteGitHub

About

A small, lightweight and easy-to-use Laravel package for handling markdown.

⚠️ Important

This project is no longer maintained, will not received any updates and will not support future versions of Laravel.


Laravel-Markdown

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.

Laravel version Laravel-Markdown version
5.8, 6.* 3.1.1
5.7 3.0.1
5.6 3.0
5.5 2.0
5.3, 5.4 1.1
5.2 1.0

Installation

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

composer require andreasindal/laravel-markdown:"3.0.1"

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

Usage

Blade-directive

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

xml

    
{{ $post->title }}

    
        @markdown($post->body)
    

You can also use a block-style syntax:

markdown
@markdown
# Hello world

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

Facade

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

php
$markdown = "# Hello";

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

Helper-functions

php
$html = markdown('# Hello'); // 
Hello
php
$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.

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

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 Indal\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 by @erusev.

Credits

  • Mohamed Said (@themsaid)

License

Licensed under MIT. For more information, see the LICENSE-file.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPbladelaravelmarkdown

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架