fix devops error
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user