jeudi 26 octobre 2017

laravel 5.4 register after payment

I am working on an application where users can register after payment, below is my create method in RegisterController

protected function create(array $data)
{

    $payment = $this->MakePayment($data);

    if($payment->error)
    {
        flash($payment->error, 'error')->important();
        redirect()->route('register');
    }
    else
    {
        //create user and return it
        return $user;
    }
}

but I get exception instead of returning back (1/1) FatalThrowableError

Type error: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, null given, called in /home/tariqmahmood/www/http://ift.tt/2h9UrhV on line 35

Also I have tried exit() after redirect, it takes back to register route but empty screen. Can anyone please let me know what I am doing wrong.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2y6lXaC
via IFTTT

Aucun commentaire:

Enregistrer un commentaire