fix devops error
This commit is contained in:
@@ -4,62 +4,20 @@ namespace App\Repositories\Botanic;
|
||||
|
||||
use App\Exports\Botanic\FamiliesExport;
|
||||
use App\Models\Botanic\Family;
|
||||
use App\Traits\Model\Basic;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Yajra\DataTables\DataTables;
|
||||
|
||||
class Families
|
||||
{
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Family::orderBy('name');
|
||||
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Family::get()->SortBy('name')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Family::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Family::findOrFail($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$item = $id ? self::update($data, $id) : self::create($data);
|
||||
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Family::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Family::destroy($id);
|
||||
}
|
||||
use Basic;
|
||||
|
||||
public static function exportExcel()
|
||||
{
|
||||
return Excel::download(new FamiliesExport, 'families.xlsx');
|
||||
return Excel::download(new FamiliesExport(), 'families.xlsx');
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Family::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,53 +4,20 @@ namespace App\Repositories\Botanic;
|
||||
|
||||
use App\Exports\Botanic\GenresExport;
|
||||
use App\Models\Botanic\Genre;
|
||||
use App\Traits\Model\Basic;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class Genres
|
||||
{
|
||||
public static function getOptions()
|
||||
{
|
||||
return Genre::get()->SortBy('name')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Genre::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Genre::find($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Genre::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$model = self::get($id);
|
||||
$model->update($data);
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Genre::destroy($id);
|
||||
}
|
||||
use Basic;
|
||||
|
||||
public static function exportExcel()
|
||||
{
|
||||
return Excel::download(new GenresExport, 'genres.xlsx');
|
||||
return Excel::download(new GenresExport(), 'genres.xlsx');
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Genre::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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