cr4sec/user-channels 问题修复 & 功能扩展

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

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

cr4sec/user-channels

Composer 安装命令:

composer require cr4sec/user-channels

包简介

Test task: adding the subscribed channels setting to the user

README 文档

README

Total Downloads Version Dependents License

This is a test project for working with creating your own package for Laravel

Installation in Laravel

  • This package can be used with Laravel 5.8 or higher.
  • This package publishes a config/cr4sec/channels.php file.
  • You can install the package via composer:
$ composer require cr4sec/user-channels
  • Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [
    // ...
    Cr4Sec\UserChannels\ChannelsServiceProvider::class,
];
  • You should publish the migration, component and the channels.php config file with:
$ php artisan vendor:publish --provider="Cr4Sec\UserChannels\ChannelsServiceProvider"
  • You should publish the migration and the config/cr4sec/channels.php config file with:
$ php artisan migrate
  • Add the "HasChannels" trait to your User model.
class User extends Authenticatable
{
    // ...
    use Cr4Sec\UserChannels\Traits\HasChannels;

Usage

Get user channels

$user->channels;

User's subscription to channels

$user->attachChannel(['afgt6d3', 'a54dhyt']);
$user->attachChannel('afg7');
$user->attachChannel(Channel::first);

User's unsubscription to channels

$user->channels()->detach(['afgt6d3', 'a54dhyt']);

Blade component

<x-user-channels-list-component :channels="$channels"/>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固