db); $model = $this->entity::find($this->id); $e_invoice_standard = $model->client ? $model->client->getSetting('e_invoice_type') : $model->company->getSetting('e_invoice_type'); if($e_invoice_standard != 'PEPPOL') return; if(Ninja::isSelfHost() && ($model instanceof Invoice) && $model->company->legal_entity_id) { //self hosted sender } if(Ninja::isHosted() && ($model instanceof Invoice) && $model->company->legal_entity_id) { //hosted sender } return; } public function failed($exception = null) { if ($exception) { nlog("EXCEPTION:: SENDEDOCUMENT::"); nlog($exception->getMessage()); } config(['queue.failed.driver' => null]); } public function middleware() { return [new WithoutOverlapping($this->entity.$this->id.$this->db)]; } }