PHPackages                             yuanchao/laravel-5-markdown-editor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. yuanchao/laravel-5-markdown-editor

ActiveLibrary

yuanchao/laravel-5-markdown-editor
==================================

Based on the markdown editor laravel 5

2425.5k41[12 issues](https://github.com/yccphp/laravel-5-markdown-editor/issues)[1 PRs](https://github.com/yccphp/laravel-5-markdown-editor/pulls)JavaScript

Since Jun 6Pushed 9y ago14 watchersCompare

[ Source](https://github.com/yccphp/laravel-5-markdown-editor)[ Packagist](https://packagist.org/packages/yuanchao/laravel-5-markdown-editor)[ RSS](/packages/yuanchao-laravel-5-markdown-editor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-5-markdown-editor
=========================

[](#laravel-5-markdown-editor)

Based on the markdown editor laravel 5

一个基于 laravel 5 的markdown 编辑器

本项目基于 html&amp;js 一个有情怀的编辑器二次开发完成 [传送门](https://github.com/Integ/BachEditor)

安装使用详细教程
========

[](#安装使用详细教程)

phphub:

如果访问 phphub 比较慢的同学，可以访问这个

SegmentFault:

不需要敲语法可界面操作的功能
==============

[](#不需要敲语法可界面操作的功能)

1. 加粗字体
2. 加斜字体
3. `无需手写 md插入链接`
4. 引用
5. `无需手写 md 语法插入图片`
6. 数字列表
7. 普通列表
8. 标题
9. 分割
10. 撤销
11. 重做
12. 全屏

Bug 反馈&amp;交流
=============

[](#bug-反馈交流)

欢迎加入我们的 laravel 学习小组：`365969825`

预览
==

[](#预览)

[![](https://camo.githubusercontent.com/d65c436c443ea54c2e81bb86070deaddbecdc7ed7167b7eeadff7c05933e32d1/687474703a2f2f7777772e70687063746f2e6f72672f746d702f6d312e6a7067)](https://camo.githubusercontent.com/d65c436c443ea54c2e81bb86070deaddbecdc7ed7167b7eeadff7c05933e32d1/687474703a2f2f7777772e70687063746f2e6f72672f746d702f6d312e6a7067)

[![](https://camo.githubusercontent.com/fb2aa51578a74e52726cbe59050e586f8d74ee6a74acae29768b046e01b3dd29/687474703a2f2f7777772e70687063746f2e6f72672f746d702f6d322e6a7067)](https://camo.githubusercontent.com/fb2aa51578a74e52726cbe59050e586f8d74ee6a74acae29768b046e01b3dd29/687474703a2f2f7777772e70687063746f2e6f72672f746d702f6d322e6a7067)

Update Log
==========

[](#update-log)

`2015-05-18` 初版提交

`2015-05-19` 图片上传移植到扩展内部处理

`2015-05-19` 新增解析 markdown 为 html 功能

Installation
============

[](#installation)

1.在 `composer.json` 的 require里 加入

```
"yuanchao/laravel-5-markdown-editor": "dev-master"

```

2.执行 `composer update`

3.在config/app.php 的 `providers` 数组加入一条

```
'YuanChao\Editor\EndaEditorServiceProvider'

```

4.在config/app.php 的 `aliases` 数组加入一条

```
'EndaEditor' => 'YuanChao\Editor\Facade\EndaEditorFacade'

```

5.执行 `php artisan vendor:publish --tag=EndaEditor`

执行完上面的命令后，会生成配置文件和视图文件到你的 config/ 和 views/vendor 目录

Usage
=====

[](#usage)

1.在需要编辑器的地方插入以下代码

```
// 引入编辑器代码
@include('editor::head')

// 编辑器一定要被一个 class 为 editor 的容器包住

	// 创建一个 textarea 而已，具体的看手册，主要在于它的 id 为 myEditor
	{!! Form::textarea('content', '', ['class' => 'form-control','id'=>'myEditor']) !!}

	// 上面的 Form::textarea ，在laravel 5 中被提了出去，如果你没安装的话，直接这样用

	// 主要还是在容器的 ID 为 myEditor 就行

```

这个时候，编辑器就出来啦～

#### 图片上传移植到扩展内部处理

[](#图片上传移植到扩展内部处理)

`图片上传移植到扩展的功能上传时间为 2015-05-19 10:40 如果在这个时间前安装的朋友，请先更新`

2.图片上传配置，打开config/editor.php 配置文件，修改里面的 `uploadUrl` 配置项，为你的处理上传的 action

我的上传 action 代码为

```
use EndaEditor;

public function postUpload(){

		// endaEdit 为你 public 下的目录 update 2015-05-19
        $data = EndaEditor::uploadImgFile('endaEdit');

        return json_encode($data);
}

```

3.链接添加功能添加了方便的添加系统内部文章的特性，首先在config/editor.php配置文件添加 `ajaxTopicSearchUrl` 配置项，关于返回的数据格式，请在配置文件中查看注释。

之后在您没有选中任何字符的情况下点击添加链接，将会看到多了一个标题输入框，您输入一些字符，它会根据 `ajaxTopicSearchUrl` 获得的文章标题列表来生成自动补全的下拉列表。

当您选中某个文章之后，下面的链接也会自动被填上。 ###完成以上这些配置，你就可以在线插入图片啦

### 新增解析 markdown 为 html 功能

[](#新增解析-markdown-为-html-功能)

头部引用文件

```
use EndaEditor;

```

列子如下：

```

        $art = Article::find(16);

        return view('test',[
            'content'=>EndaEditor::MarkDecode($art->content)
        ]);

```

直接把需要解析的 markdown 扔进这个方法就行

```
EndaEditor::MarkDecode("#我是参数")

```

为了保证图片的显示正常，加入[zoom插件](https://github.com/fat/zoom.js)

在需要解码的页面确保引入了bootstrap，并加入如下代码

```
@include('editor::decode')

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/280e78a6790d59cce70a5c458d327e3a94f10dd6a2c8ca3e1cee9c445a3e389f?d=identicon)[yuanchao](/maintainers/yuanchao)

---

Top Contributors

[![endachao](https://avatars.githubusercontent.com/u/8328651?v=4)](https://github.com/endachao "endachao (17 commits)")[![zedisdog](https://avatars.githubusercontent.com/u/8280666?v=4)](https://github.com/zedisdog "zedisdog (3 commits)")

### Embed Badge

![Health badge](/badges/yuanchao-laravel-5-markdown-editor/health.svg)

```
[![Health](https://phpackages.com/badges/yuanchao-laravel-5-markdown-editor/health.svg)](https://phpackages.com/packages/yuanchao-laravel-5-markdown-editor)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
