parsedown / laravel by eagostini

Official Parsedown's Laravel Wrapper.
91,640
54
4
Package Data
Maintainer Username: eagostini
Maintainer Contact: edu.agostini@gmail.com (Eduardo Agostini)
Package Create Date: 2017-05-08
Package Last Update: 2020-07-04
Home Page: http://parsedown.org
Language: PHP
License: MIT
Last Refreshed: 2020-09-24 03:22:03
Package Statistics
Total Downloads: 91,640
Monthly Downloads: 7,538
Daily Downloads: 244
Total Stars: 54
Total Watchers: 4
Total Forks: 9
Total Open Issues: 1

You might also like Caret - our Markdown editor for Mac / Windows / Linux.

Parsedown for Laravel

Build Status

A Laravel wrapper of Parsedown to extend its features. If you want to know more about Parsedown alone check out our base repository.

Features

  • Blade Directive
  • Helper Function

Installation

Parsedown for Laravel is available as a composer package. You can install it using the command below:

composer require "parsedown/laravel"

Configuration

If you're using Laravel +5.5 you don't need to follow the steps below. The package auto-discovery feature has been implemented and will take care of loading the service provider for you.

But if that's not your case you just need to add the service provider to your config/app.php:

return [
    // Other configurations above...

    'providers' => [
        // Other providers above...
        Parsedown\Providers\ParsedownServiceProvider::class,
        // Other providers below...
    ],

    // Other configurations below...
];

Usage

@parsedown('Hello _Parsedown_!')

or (using a helper approach)

{{ parsedown('Hello _Parsedown_!') }}

Any of the codes above will generate:

<p>Hello <em>Parsedown</em>!</p>

The helper can also be used with PHP throughout the project.

Lumen Support

As Laravel and Lumen share pretty much the same core the instructions below should be enough to set this package in yout Lumen project.

Enable Facades in Your Project

In your bootstrap/app.php ensure you have the following:

$app->withFacades();

Service Provider Registering

As Lumen does not support package auto-discovery you got to do it manually adding the code below in your bootstrap/app.php:

$app->register(Parsedown\Providers\ParsedownServiceProvider::class);