Move email/ resources to mail/, added invoice generated email to admin, updated email template

This commit is contained in:
2024-08-03 10:06:25 +10:00
parent f8453ae391
commit 0469d64577
40 changed files with 439 additions and 213 deletions

View File

@@ -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;
}
}