Download the PHP package vinelab/laravel-editor without Composer
On this page you can find all versions of the php package vinelab/laravel-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vinelab/laravel-editor
More information about vinelab/laravel-editor
Files in vinelab/laravel-editor
Package laravel-editor
Short Description Markdown Text Editor (WYSIWYG) with social network embeds support and a nifty json output.
License
Informations about the package laravel-editor
Markdown Editor
A sophisticated markdown editor supporting different kinds of embeds (Facebook, Twitter, Youtube, Images, Links) and transforms content into a clean JSON to be delivered to mobile devices or custom front-end UI.
Installation
-
Add the package to your
composer.json
and runcomposer update
. -
Add the service provider to the
providers
array inapp/config/app.php
-
Publish the assets by running
php artisan asset:publish vinelab/laravel-editor
at the root of your project. - Access the editor with the
Editor
facade
Dependencies
- jQuery
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
-
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
- Mr.Uploader: To have the photo cropping and upload working you need to add
Social Media Embeds
To have all the embeds working in the preview you will need to add the social media scripts to your HTML.
Usage
Displaying the Editor
To display the editor you simply need to call
You may also call it passing existing content
Example with a Form
Retrieving Content
To get the content from the input use Editor::input()
to get the editor's input name and use it with Input
as such
Then pass it to Editor::content($input)
for the raw content or Editor::json($input)
for the JSON representation
of the output.
Raw Content
The text used in the editor for this example is the following:
JSON
Lines are all 0 indexed