Fix code creation for invoices

This commit is contained in:
Deon George 2020-06-02 17:19:24 +10:00
parent 251298a230
commit d7829b93b9
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ class Invoice extends Model
$io->save();
}
$code = (! $io) ? Doorman::generate()->for($this->account->user->email)->uses(0)->expiresOn($tokendate)->make() : $io->code;
$code = (! $io) ? Doorman::generate()->for($this->account->user->email)->uses(0)->expiresOn($tokendate)->make()->first()->code : $io->code;
return url('u/invoice',[$this->id,'email',$code]);
}