add shipping rules
This commit is contained in:
@@ -2,14 +2,11 @@
|
||||
|
||||
namespace App\Repositories\Botanic;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Exports\Botanic\SpeciesExport;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class Species
|
||||
{
|
||||
@@ -33,6 +30,7 @@ class Species
|
||||
public static function getTags($id)
|
||||
{
|
||||
$model = self::get($id) ?? false;
|
||||
|
||||
return $model ? $model->tags->toArray() : false;
|
||||
}
|
||||
|
||||
@@ -41,6 +39,7 @@ class Species
|
||||
$specie = self::get($id);
|
||||
$data = $specie->toArray();
|
||||
$data['tags'] = self::getTagsBySpecie($specie);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -49,7 +48,6 @@ class Species
|
||||
return Tag::getTagsByModel($specie);
|
||||
}
|
||||
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Specie::with('tags.tag_group')->find($id);
|
||||
@@ -64,6 +62,7 @@ class Species
|
||||
$specie = self::store($data);
|
||||
self::storeImages($specie, $images);
|
||||
self::storeTags($specie, $tags);
|
||||
|
||||
return $specie;
|
||||
}
|
||||
|
||||
@@ -82,6 +81,7 @@ class Species
|
||||
$id = $id ? $id : $data['id'];
|
||||
$model = self::get($id);
|
||||
$ret = $model->update($data);
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user