64 lines
1.2 KiB
PHP
64 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Botanic\Admin;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Repositories\Botanic\Species;
|
|
use App\Repositories\Botanic\Genres;
|
|
use App\Datatables\Botanic\SpeciesDataTable;
|
|
|
|
class SpecieController extends Controller
|
|
{
|
|
public function index(SpeciesDataTable $dataTable)
|
|
{
|
|
return $dataTable->render('Botanic.Admin.Species.list');
|
|
}
|
|
|
|
public function getDatatable(Request $request)
|
|
{
|
|
return Species::getDatatable($request->all());
|
|
}
|
|
|
|
public function getOptions()
|
|
{
|
|
return response()->json(Species::getOptions());
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
return view('Botanic.Admin.Species.create');
|
|
}
|
|
|
|
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 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 exportExcel()
|
|
{
|
|
return Species::exportExcel();
|
|
}
|
|
}
|