add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch
This commit is contained in:
@@ -4,7 +4,6 @@ namespace App\Models\Shop;
|
||||
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Traits\Model\HasComments;
|
||||
use App\Traits\Model\Imageable;
|
||||
use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin;
|
||||
@@ -105,7 +104,7 @@ class Article extends Model implements HasMedia
|
||||
return $query->where($this->table.'.name', 'LIKE', '%'.$str.'%');
|
||||
}
|
||||
|
||||
public function scopeSearch($query, $str)
|
||||
public function scopeRawSearch($query, $str)
|
||||
{
|
||||
return $query->where($this->table.'.name', 'LIKE', '%'.$str.'%');
|
||||
}
|
||||
@@ -148,6 +147,11 @@ class Article extends Model implements HasMedia
|
||||
return $query->whereIn($this->table.'.product_type', [Variety::class, Specie::class]);
|
||||
}
|
||||
|
||||
public function scopeByIDs($query, $ids)
|
||||
{
|
||||
return $query->whereIN($this->table.'.id', $ids);
|
||||
}
|
||||
|
||||
public function scopeMerchandise($query)
|
||||
{
|
||||
return $query->byProduct(Merchandise::class);
|
||||
@@ -218,6 +222,7 @@ class Article extends Model implements HasMedia
|
||||
|
||||
return [
|
||||
'id' => (int) $this->id,
|
||||
'article_nature_id' => $this->article_nature_id,
|
||||
'name' => $this->name,
|
||||
'description' => html_entity_decode(strip_tags($description)),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user