fix devops error
This commit is contained in:
@@ -5,17 +5,13 @@ namespace App\Repositories\Botanic;
|
||||
use App\Exports\Botanic\VarietiesExport;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class Varieties
|
||||
{
|
||||
use Imageable;
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Variety::orderBy('name')->get()->pluck('name', 'id')->toArray();
|
||||
}
|
||||
use Basic, Imageable;
|
||||
|
||||
public static function getOptionsWithSpecie()
|
||||
{
|
||||
@@ -29,11 +25,6 @@ class Varieties
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Variety::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function getDescription($id)
|
||||
{
|
||||
return self::get($id)->description;
|
||||
@@ -65,8 +56,8 @@ class Varieties
|
||||
|
||||
public static function storeFull($data)
|
||||
{
|
||||
$images = isset($data['images']) ? $data['images'] : false;
|
||||
$tags = isset($data['tags']) ? $data['tags'] : false;
|
||||
$images = $data['images'] ?? false;
|
||||
$tags = $data['tags'] ?? false;
|
||||
unset($data['images']);
|
||||
unset($data['tags']);
|
||||
$variety = self::store($data);
|
||||
@@ -76,30 +67,6 @@ class Varieties
|
||||
return $variety;
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Variety::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$variety = self::get($id);
|
||||
$ret = $variety->update($data);
|
||||
|
||||
return $variety;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Variety::destroy($id);
|
||||
}
|
||||
|
||||
public static function storeTags($variety, $tags)
|
||||
{
|
||||
return Tag::storeTags($variety, $tags);
|
||||
@@ -107,6 +74,11 @@ class Varieties
|
||||
|
||||
public static function exportExcel()
|
||||
{
|
||||
return Excel::download(new VarietiesExport, 'varieties.xlsx');
|
||||
return Excel::download(new VarietiesExport(), 'varieties.xlsx');
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Variety::query();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user