dbr0/surveys 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dbr0/surveys

Composer 安装命令:

composer require dbr0/surveys

包简介

Survey Laravel package

README 文档

README

A Laravel survey package

Add to your Laravel project:

In composer.json under "require" add:

"dbr0/surveys": "^0.0.11"

Run: composer update.

Add

dbr0\surveys\SurveysServiceProvider::class,

to your config/app/ file under 'providers'.

Publish config/migrations/views:

php artisan vendor:publish --provider="dbr0\surveys\SurveysServiceProvider" --tag=config
php artisan vendor:publish --provider="dbr0\surveys\SurveysServiceProvider" --tag=migrations
php artisan vendor:publish --provider="dbr0\surveys\SurveysServiceProvider" --tag=views`

Run: php artisan migrate

Add

use SurveyOwner;

to your desired model. Default is App\User but you still need to add the use SurveyOwner to it.

Update owner_model array item in config/dbr0-surveys/main.php with name of your model. Default is App/User.

Access control and Middleware

A package comes with dummy middleware which you can publish using:

php artisan vendor:publish --provider="dbr0\surveys\SurveysServiceProvider" --tag=middleware

To use the middlewares you need to add them to $routeMiddleware variable inside of app/Http/Kernel.php file.

ie.

protected $routeMiddleware = [
        ...
        'visibleSurveys' => VisibleSurveys::class,
    ];

You can update these middlewares to limit user CRUD actions. To apply them to certain route you need to update the config file.

ie.

'routes' => [ //routes stuff
        ...
        'middleware_index' => [visibleSurveys], //add middleware to index
        ...
        ]

This way you can limit access to listing of surveys. The same logic can be applied to other routes.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固