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\Variety;
|
||||
use App\Exports\Botanic\VarietiesExport;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class Varieties
|
||||
{
|
||||
@@ -25,9 +22,10 @@ class Varieties
|
||||
$varieties = Variety::with('specie')->get();
|
||||
$data = [];
|
||||
foreach ($varieties as $variety) {
|
||||
$data[$variety->id] = (isset($variety->specie->name) ? $variety->specie->name . ' ' : '') . $variety->name;
|
||||
$data[$variety->id] = (isset($variety->specie->name) ? $variety->specie->name.' ' : '').$variety->name;
|
||||
}
|
||||
asort($data, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -56,6 +54,7 @@ class Varieties
|
||||
$variety = self::get($id);
|
||||
$data = $variety->toArray();
|
||||
$data['tags'] = self::getTagsByVariety($variety);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -73,6 +72,7 @@ class Varieties
|
||||
$variety = self::store($data);
|
||||
self::storeImages($variety, $images);
|
||||
self::storeTags($variety, $tags);
|
||||
|
||||
return $variety;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ class Varieties
|
||||
$id = $id ? $id : $data['id'];
|
||||
$variety = self::get($id);
|
||||
$ret = $variety->update($data);
|
||||
|
||||
return $variety;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user