承接 jhacobs/laravel-invites 相关项目开发

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

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

jhacobs/laravel-invites

Composer 安装命令:

composer require jhacobs/laravel-invites

包简介

Invite users to your laravel application

README 文档

README

Invite users to your application

Installation

You can install this package via composer

composer require jhacobs/laravel-invites

Publish the invites config file

php artisan vendor:publish --provider="Invites\InviteServiceProvider" --tag=config

Publish the migration

php artisan vendor:publish --provider="Invites\InviteServiceProvider" --tag=migrations

Now run php artisan migrate to create the invites table.

Usage

Prepare your model

Add the CanBeInvited interface to your user model

use Jhacobs\Invites\Contracts\CanBeInvited;

class User extends Authenticatable implements CanBeInvited

Implement the getEmailForInvites method, so the package knows which field is has the user's email.

public function sendInviteNotification(string $token)
{
    return 'email';
}

Implement the sendInviteNotification to send the invite notification to a user.

public function sendInviteNotification(string $token)
{
    $this->notify(new InviteUserNotification($token));
}

Send invite notification

To send the invite notification, call the sendInviteLink method on the Invite facade.

use Jhacobs\Invites\Facades\Invite;
use App\Models\User;

$user = User::find(1);

Invite::sendInviteLink($user);

Create a user's password

To create a user's password, call the createPassword method on the Invite facade.

You must pass the user's email, the unhashed token created by the sendInviteLink method and the new password for the user.

use Jhacobs\Invites\Facades\Invite;

Invite::createPassword($request->get('email'), $request->get('token'), $request->get('password'), function (User $user, string $password) {
    $user->password = Hash::make($password);
    $user->save();
});

License

This project is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固