willvincent/laravel-markdown
| Install | |
|---|---|
composer require willvincent/laravel-markdown:dev-master |
|
| PHP: | ^5.5.9 || ^7.0 |
| License: | MIT |
| Last Updated: | Jun 24, 2016 |
| Links: | GitHub · Packagist |
Laravel Markdown
Provides a markdown parser facade, with optional typographical prettification using SmartyPants to Laravel 5.x.
Installation
Download the package with composer:
composer require willvincent/laravel-markdown
NOTE: You may need to add the following to your composer.json to allow dev packages to be installed:
"minimum-stability": "dev",
"prefer-stable": true
Update your config/app.php file to reference the provider and facade:
'providers' => [
// ...
willvincent\LaravelMarkdown\LaravelMarkdownServiceProvider::class,
],
'aliases' => [
// ...
'Markdown' => willvincent\LaravelMarkdown\Facades\LaravelMarkdownFacade::class,
],
Run php artisan vendor:publish to copy the default config file into your app's config directory; config/markdown.php
Usage
Usage is simple, pass markdown you want to parse (and optionally prettify based on your config settings) to the parse() method of the Markdown facade.
// Assuming $text is a variable populated with markdown...
Markdown::parse($text)
Presumably most people will use this to display data loaded from their database within a blade template;
<div class="parsed-markdown-text">{!! Markdown::parse($text) !!}</div>
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.