fix devops error

This commit is contained in:
ludo
2024-01-05 01:30:46 +01:00
parent 90b0af5b2d
commit 5144c1f7fd
128 changed files with 410 additions and 2580 deletions

View File

@@ -5,22 +5,13 @@ namespace App\Repositories\Botanic;
use App\Exports\Botanic\SpeciesExport;
use App\Models\Botanic\Specie;
use App\Repositories\Core\Tag;
use App\Traits\Model\Basic;
use App\Traits\Repository\Imageable;
use Maatwebsite\Excel\Facades\Excel;
class Species
{
use Imageable;
public static function getOptions()
{
return Specie::get()->SortBy('name')->pluck('name', 'id')->toArray();
}
public static function getAll()
{
return Specie::orderBy('name', 'asc')->get();
}
use Basic, Imageable;
public static function getDescription($id)
{
@@ -66,30 +57,6 @@ class Species
return $specie;
}
public static function store($data)
{
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
}
public static function create($data)
{
return Specie::create($data);
}
public static function update($data, $id = false)
{
$id = $id ? $id : $data['id'];
$model = self::get($id);
$ret = $model->update($data);
return $model;
}
public static function destroy($id)
{
return Specie::destroy($id);
}
public static function storeTags($specie, $tags)
{
return Tag::storeTags($specie, $tags);
@@ -97,6 +64,11 @@ class Species
public static function exportExcel()
{
return Excel::download(new SpeciesExport, 'species.xlsx');
return Excel::download(new SpeciesExport(), 'species.xlsx');
}
public static function getModel()
{
return Specie::query();
}
}