PHP code example of binarycabin / laravel-password

1. Go to this page and download the library: Download binarycabin/laravel-password library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

binarycabin / laravel-password example snippets


return User::create([
    'name' => $data['name'],
    'email' => $data['email'],
    'password' => bcrypt($data['password']),
]);

return User::create([
    'name' => $data['name'],
    'email' => $data['email'],
    'password' => $data['password'],
]);

protected function resetPassword($user, $password){
    $user->password = $password;
    $user->setRememberToken(\Illuminate\Support\Str::random(60));
    $user->save();
    event(new \Illuminate\Auth\Events\PasswordReset($user));
    $this->guard()->login($user);
}