定制 alexwenzel/laravel-commentary 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alexwenzel/laravel-commentary

Composer 安装命令:

composer require alexwenzel/laravel-commentary

包简介

A package for Laravel to post a comment on an article and to manage them.

README 文档

README

A package for Laravel to post a comment on an article and to manage them.

Description

This package comes with 3 parts:

  • comment form
  • comment listing
  • comment management

The form allows anyone to post a comment on something. It can be applied to any view. The same goes for ther comment listing.

The comment management allows someone to

  • approve
  • unapprove
  • edit
  • trash

comments.

Screenshots

Form

form

Management

management

Implementation

ServiceProvider

'Alexwenzel\LaravelCommentary\LaravelCommentaryServiceProvider'

Namespace

The package registers the following namespace: laravel-commentary

Migration

php artisan migrate --package="alexwenzel/laravel-commentary"

The migration creates a table named: laravel-commentary-comments

Comment controllers

There is a controller to manage the comments, and there is a controller for the frontend stuff. The management controller is best behind a secured route.

Include something like the following line in your routes.php:

/**
 * Comment Management
 */
Route::controller('commentsmanagement', 'Alexwenzel\LaravelCommentary\ManagementController');

/**
 * Comment Frontend
 */
Route::controller('commentsfrontend', 'Alexwenzel\LaravelCommentary\FrontendController');

If you need to customize the management section, override the views within your project.

Comment form

To display the comment form, include something like the following line in your view:

{{ View::make('laravel-commentary::comment-form', array('entity'=>'my_article_id')) }}

Register the controller first, otherwise you will get errors.

Comment listing

To display the comments of an entity, include something like the following line in your view:

{{ View::make('laravel-commentary::comment-list', array('entity'=>'my_article_id')) }}

Register the controller first, otherwise you will get errors.

The following conditions are applied to the comment listing. Comments:

  • have to be approved
  • are ordered by creation time

Comment controller behaviour

The behaviour can be customized by overriding CommentaryActionHandler class.

Events

The following events are fired:

laravel-commentary.comment-posted // first parameter is the comment
laravel-commentary.comment-approved // first parameter is the comment
laravel-commentary.comment-unapproved // first parameter is the comment
laravel-commentary.comment-trashed // first parameter is the comment

Assets

This package comes with default styles.

php artisan asset:publish alexwenzel/laravel-commentary

Localization

Read here: http://laravel.com/docs/localization#overriding-package-language-files

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固