PHP code example of nuwira / bandrek

1. Go to this page and download the library: Download nuwira/bandrek 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/ */

    

nuwira / bandrek example snippets


Illuminate\Auth\Passwords\PasswordResetServiceProvider::class

Nuwira\Bandrek\BandrekServiceProvider::class

'Bandrek' => Nuwira\Bandrek\BandrekFacade::class,

Bandrek::getRandomCode($length = 6, $toString = true);
Bandrek::generateToken();
Bandrek::getTokenFromCode($code);
Bandrek::getCodeFromToken($token, $toString = true);

use Illuminate\Foundation\Auth\User as Authenticatable;

use Nuwira\Bandrek\Auth\User as Authenticatable;

namespace App\Notifications;

use Nuwira\Bandrek\Notification\BandrekNotification;
use Illuminate\Notifications\Messages\MailMessage;
use NotificationChannels\Gammu\GammuChannel;
use NotificationChannels\Gammu\GammuMessage;

class ResetPassword extends BandrekNotification
{
    public function via($notifiable)
    {
        return ['mail', GammuChannel::class];
    }
    
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->line('You are receiving this email because we received a password reset request for your account.')
            ->action('Reset Password', url(config('app.url').route('password.reset', $this->token, false)))
            ->line('If you did not request a password reset, no further action is 

namespace App;

use Nuwira\Bandrek\Auth\User as BaseUser;
use App\Notifications\ResetPassword as ResetPasswordNotification;

class User extends BaseUser
{
    public function sendPasswordResetNotification($token)
    {
        $this->notify(new ResetPasswordNotification($token));
    }
}