Fixes for base driver

This commit is contained in:
David Bomba 2020-09-09 20:05:10 +10:00
parent 1ee6e33bb7
commit c67fee3fff
3 changed files with 21 additions and 1 deletions

View File

@ -47,6 +47,8 @@ class StoreDesignRequest extends Request
$input['design']['task'] = '';
}
$input['design'] = htmlspecialchars($input['design']);
$this->replace($input);
}
}

View File

@ -37,7 +37,7 @@ class RecurringInvoicesCron
public function handle() : void
{
/* Get all invoices where the send date is less than NOW + 30 minutes() */
info("Sending recurring invoices {Carbon::now()->format('Y-m-d h:i:s')}");
info("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s'));
if (! config('ninja.db.multi_db_enabled')) {

View File

@ -16,6 +16,7 @@ use App\Events\Invoice\InvoiceWasPaid;
use App\Factory\PaymentFactory;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
use App\Models\Client;
use App\Models\ClientContact;
use App\Models\ClientGatewayToken;
use App\Models\CompanyGateway;
use App\Models\Invoice;
@ -192,4 +193,21 @@ class BaseDriver extends AbstractPaymentDriver
}
});
}
/**
* Return the contact if possible.
*
* @return ClientContact The ClientContact object
*/
public function getContact()
{
if ($this->invitation) {
return ClientContact::find($this->invitation->client_contact_id);
} elseif (auth()->guard('contact')->user()) {
return auth()->user();
} else {
return false;
}
}
}