change icons, css, add routing to merchandise, add mail templater, fixes
This commit is contained in:
21
app/Models/Core/Mail/MailLog.php
Normal file
21
app/Models/Core/Mail/MailLog.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\Mail;
|
||||
|
||||
use App\Repositories\Core\DateTime;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MailLog extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function scopeByDestination($query, $email)
|
||||
{
|
||||
return $query->where('sent_to', $email);
|
||||
}
|
||||
|
||||
public function getCreatedAtAttribute($value)
|
||||
{
|
||||
return DateTime::DateTimeToLocale($value);
|
||||
}
|
||||
}
|
||||
21
app/Models/Core/Mail/MailTemplate.php
Normal file
21
app/Models/Core/Mail/MailTemplate.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\Mail;
|
||||
|
||||
use App\Traits\HasTranslations;
|
||||
use Spatie\MailTemplates\Models\MailTemplate as parentMailTemplate;
|
||||
use Venturecraft\Revisionable\RevisionableTrait;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
|
||||
class MailTemplate extends parentMailTemplate
|
||||
{
|
||||
use HasTranslations, RevisionableTrait, Userstamps;
|
||||
|
||||
protected $connection = 'central';
|
||||
|
||||
public $translatable = ['subject', 'html_template', 'text_template'];
|
||||
|
||||
protected $revisionCreationsEnabled = false;
|
||||
|
||||
protected $keepRevisionOf = ['subject', 'html_template', 'text_template'];
|
||||
}
|
||||
@@ -141,12 +141,12 @@ class Article extends Model implements HasMedia
|
||||
|
||||
public function scopeByProduct($query, $model)
|
||||
{
|
||||
return $query->where($this->table . '.product_type', $model);
|
||||
return $model ? $query->where($this->table . '.product_type', $model) : $query;
|
||||
}
|
||||
|
||||
public function scopeByProductId($query, $model_id)
|
||||
public function scopeByProductId($query, $product_id)
|
||||
{
|
||||
return $query->where($this->table . '.product_id', $model_id);
|
||||
return $product_id ? $query->where($this->table . '.product_id', $product_id) : $query;
|
||||
}
|
||||
|
||||
public function scopeByTag($query, $tag_id)
|
||||
|
||||
@@ -25,14 +25,14 @@ class ArticleNature extends Model
|
||||
return $query->where($this->table . '.id', $id);
|
||||
}
|
||||
|
||||
public function scopeByBotanic($query);
|
||||
public function scopeByBotanic($query)
|
||||
{
|
||||
return $query->where($this->table . '.product_type', 1);
|
||||
return $query->ByProductType(1);
|
||||
}
|
||||
|
||||
public function scopeByMerchandise($query);
|
||||
public function scopeByMerchandise($query)
|
||||
{
|
||||
return $query->where($this->table . '.product_type', 2);
|
||||
return $query->ByProductType(2);
|
||||
}
|
||||
|
||||
public function scopeByProductType($query, $type)
|
||||
|
||||
Reference in New Issue
Block a user