PHP code example of duro85 / ajaxauth

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

    

duro85 / ajaxauth example snippets


Duro85\AjaxAuth\AjaxAuthServiceProvider::class,
Duro85\AjaxAuth\AjaxAuthRouteServiceProvider::class,

php artisan vendor:publish

    public function sendPasswordResetNotification($token)
    {        
        $this->notify(new AjaxAuthNotification($token, 'guard_name', ['name' => $this->name]));
    }

public function toMail($notifiable)
    {
        // get password config 
        $config = config("auth.passwords.{$this->guard}");
        if (isset($config['view'])) {
            /*
             * custom view message
             */
            return (new MailMessage)->view($config['view'], $this->mail_params);
        } else {
            /**
             * standard laravel notification email with localizable test            
             */
            //you can specify a different route for each guard
            $link = isset($config['route']) ? route($config['route'], $this->token) : route('password.reset', $this->token);            
            return (new MailMessage)->view()
                            ->line('You are receiving this email because we received a password reset request for your account.')
                            ->action('Reset Password', $link)
                            ->line('If you did not request a password reset, no further action is