Fixes
This commit is contained in:
@@ -11,52 +11,53 @@ use App\Datatables\Botanic\SpeciesDataTable;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
public function index(SpeciesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Species.list');
|
||||
}
|
||||
public function index(SpeciesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Species.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
public function getOptions()
|
||||
{
|
||||
return response()->json(Species::getOptions());
|
||||
}
|
||||
public function getOptions()
|
||||
{
|
||||
return response()->json(Species::getOptions());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Botanic.Admin.Species.create');
|
||||
}
|
||||
public function create()
|
||||
{
|
||||
return view('Botanic.Admin.Species.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Species::store($request);
|
||||
return redirect()->route('Botanic.Admin.Species.index');
|
||||
}
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Species::store($data);
|
||||
return redirect()->route('Botanic.Admin.Species.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Botanic.Admin.Species.view', $data);
|
||||
}
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Botanic.Admin.Species.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Botanic.Admin.Species.edit', $data);
|
||||
}
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Botanic.Admin.Species.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Species::exportExcel();
|
||||
}
|
||||
public function exportExcel()
|
||||
{
|
||||
return Species::exportExcel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class Species
|
||||
public static function store($data)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$item = $id ? self::update($data) : self::create($data);
|
||||
$item = $id ? self::update($data, $id) : self::create($data);
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
@@ -48,9 +48,12 @@ class Species
|
||||
return Specie::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
return Specie::find($id)->update($data);
|
||||
$id = $id ? $id : $data['id'];
|
||||
$model = self::get($id);
|
||||
$ret = $model->update($data);
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
|
||||
@@ -36,7 +36,7 @@ class Articles
|
||||
$data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens();
|
||||
$data['families_options'] = ArticleFamilies::getOptions();
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['packages'] = ($data['article_family_id'] ?? false) ? Packages::getSelectByFamily($data['article_family_id']) : [];
|
||||
$data['packages'] = ($data['article']['article_family_id'] ?? false) ? Packages::getSelectByFamily($data['article']['article_family_id']) : [];
|
||||
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
$data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés'];
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user