editor.mdis a highly customizablemarkdowneditor, the official website: https://pandao.github.io/editor.md/.
This extension package has been tested and is adapted to stable versions Laravel 5.1 or above (version 5.0 is also theoretically feasible, but has not been tested).
Special note: Problems may arise when
composeranalyzes certain dependencies: For example, in theLaravel 5.2main project, if you install this extension package, you may install the5.3version ofilluminate/supportandilluminate/contracts-related dependency package, which may cause errors in the5.2main project. To do this, this package specifically removes the dependency on"illuminate/support": "~5.1"incomposer.json.
Add "douyasi/laravel-editor-md": "dev-master" dependency in composer.json , and then execute the: composer update operation.
After the dependency is installed, add it in app.php :
' providers ' => [
' DouyasiEditorEditorServiceProvider ' ,
], Then, execute the artisan command below to publish the extension package configuration and other items.
php artisan vendor:publish --force Now you can access the /laravel-editor-md/example route, and nothing unexpected happens, you can see the sample page provided by the extension package.
The editor image will be uploaded to the public/uploads/content directory by default; the editor-related function configuration is located in config/editor.php file.
Use the following three methods in the blade template: editor_css() , editor_js() and editor_config() .
<!DOCTYPE html >
< html lang =" en " >
< head >
< meta charset =" UTF-8 " >
< title > editor.md example </ title >
{!! editor_css() !!}
</ head >
< body >
< h2 > editor.md example </ h2 >
< div id =" mdeditor " >
< textarea class =" form-control " name =" content " style =" display:none; " >
# editor.md for Laravel
> editor.md example
</ textarea >
</ div >
{!! editor_js() !!}
{!! editor_config('mdeditor') !!}
</ body >
</ html >