Add new version in repository
This commit is contained in:
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
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('Admin.Botanic.Species.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
public function getOptions()
|
||||
{
|
||||
return response()->json(Species::getOptions());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Admin.Botanic.Species.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Species::store($data);
|
||||
return redirect()->route('Admin.Botanic.Species.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Admin.Botanic.Species.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['specie'] = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Admin.Botanic.Species.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Species::exportExcel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user