Git Product home page Git Product logo

laravel-api-password-recover's Introduction

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

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

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;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.