Laravel-API-Password-Recover:Laravel API软件包,可为API路由生成密码恢复路由

  • B9_543929
  • 36.9KB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-06-14 23:58
Laravel:API忘记了密码帮助器 介绍 节省创建函数的时间,以管理laravel中您Api的忘记密码。 该软件包将为您的用户模型添加一个新密钥,以及两条新路径将处理被忘记和重置的密码。 快速使用 作曲家 composer require appoly/api-password-helper 用法 将新密钥添加到您的用户表。 php artisan migrate 该用户模型需要法定作为电子邮件将被自动发送给他们 class User extends Authenticatable { use Notifiable; 路线 在您的应用程序中将创建两条新路线 GET: /api/forgot-password? Post路由在请求密钥和密码中采用两个表单数据参数。 POST: /api/forgot-password 如果您的
# Laravel: API forgotten password helper ## Introduction Save time creating functions to manage forgotten passwords in laravel for your Api's. This package will add a new key to your users model, along with two new routes that will handle the forgotten and reset password. ## Quick Usage ### Composer ``` composer require appoly/api-password-helper ``` ## Usage Add the new key to your users table. ``` php artisan migrate ``` The Users Model needs to be _Notifiable_ as an email will be automatically sent to them ``` class User extends Authenticatable { use Notifiable; ``` ### Routes Two new routes will be created in your application ``` GET: /api/forgot-password? ``` The Post route takes two form data parameters in the request _key_ and _password_. ``` POST: /api/forgot-password ``` If your user model has `$fillable` ensure that `password_helper_key` is added to the list of fields that are allowed to be updated. ## Edit the email To edit the email you need to publish the config to your project using ```bash php artisan vendor:publish --tag=api-password-helper-config --force ``` This will add the LaravelApiPasswordHelper file to your config folder, from there you can edit different sections of the email ## SmartSchema Compatibility If you are using [SmartSchema]( to manage your models fillables then add SmartField to your model ``` class User extends Authenticatable { use Notifiable, SmartField; ```