Move email/ resources to mail/, added invoice generated email to admin, updated email template
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
trait PushNew
|
||||
{
|
||||
@@ -22,7 +23,7 @@ trait PushNew
|
||||
// us to recurse into all of these nested relations for the model instance.
|
||||
foreach ($this->relations as $key => $models) {
|
||||
// If we are not pushable, jump to the next item.
|
||||
if (! is_array($this->pushable) OR ! in_array($key,$this->pushable))
|
||||
if ((! is_array($this->pushable)) || (! in_array($key,$this->pushable)))
|
||||
continue;
|
||||
|
||||
$models = $models instanceof Collection
|
||||
@@ -32,6 +33,8 @@ trait PushNew
|
||||
$model->setAttribute($this->getForeignKey(),$this->{$this->getKeyName()});
|
||||
|
||||
if (! $model->pushNew()) {
|
||||
Log::alert('Failed to save model',['attrs'=>$model->getAttributes()]);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user