承接 quanton-lab/feedback 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

quanton-lab/feedback

Composer 安装命令:

composer require quanton-lab/feedback

包简介

A dead simple feedback package for Laravel

README 文档

README

This is a really simple package that ables you to handle Feedback.

It comes out of the box with an Eloquent implementation but feel free to create your own custom implementation of the interfaces. (See below)

Get Started

Install with composer

Run composer require quanton-lab/feedback.

Implement Feedbackable

An object from your model should implement the Feedbackable interface in order to be associated with notes and comments. Note that you can use the trait to actually implement the methods required by the interface.

Implement Feedbacker

An object from you model should implement the Feedbacker interface if you want to keep track of who gave which notes. Generally speaking it will be some kind of user.
This interface is not mandatory.

Use the FeedbackService

Create feedback

Make a feedback on a feedbackable item with the service, returns the instance of the feedback. Then you can save it.

$feedback = $feedbackService->make(Feedbackable $feedbackable, $note, $comment, Feedbacker $feedbacker);

$feedback->save();

Or you can simply create it so you don't have to save it yourself.

$feedback = $feedbackService->create(Feedbackable $feedbackable, $note, $comment, Feedbacker $feedbacker);

Once you have the $feedback instance, you can edit it with the setters methods and then save your changes.

Retrieve feedbacks

On a Feedbackable instance, you can retrieve all associated feedbacks as well as the average note

$avgNote = $feedbackable->getAverageNote();

$feedbacks = $feedbackable->getFeedbacks();

If you're not working with Eloquent

This package provides you interfaces that you can implement any other way you want.

  1. Write your own implementation of FeedbackServiceand Feedback.
  2. Note that a Feedbackableitem cannot be implementent with the use of the Trait, you'll have to write your own.
  3. Publish FeedbackService provider and bind your own implementation of FeedbackService and Feedback to the container.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固