Nasrul Hazim Bin Mohamad

Reset Your Password from API


As you may know, Laravel provide a scaffold auth, which include reset/forgot password on web applications side. But what if you have a mobile application that need to reset password from the mobile application?

In this post, I’ll show you how to reset user’s password from an API in Laravel.

UPDATE 02/07/2017:

In case you’re looking for App\Transformers\Json, you basically can create a class called Json in app/Transformers directory.

In the Json class:


namespace App\Transformers;

class Json
    public static function response($data = null, $message = null)
        return [
            'data'    => $data,
            'message' => $message,

Please make sure to composer dumpautoload -o afterward.

Git: Undo


Here are some undo commands, depending on situation.

# To go back to staging from commit
git reset --soft HEAD~

# Unstaging
git reset HEAD <file>

# Undo Changes Made to the File
git checkout -- <file>