52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Shop\Admin;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Repositories\Shop\Species;
|
|
use App\DataTables\SpeciesDataTable;
|
|
|
|
class SpecieController extends Controller
|
|
{
|
|
public function index(SpeciesDataTable $dataTable)
|
|
{
|
|
return $dataTable->render('Shop.Admin.Species.list');
|
|
}
|
|
|
|
public function getDatatable(Request $request)
|
|
{
|
|
return Species::getDatatable($request->all());
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
return view('Shop.Admin.Species.create');
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$ret = Species::store($request);
|
|
return redirect()->route('Shop.Admin.Species.index');
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
$data = Species::get($id);
|
|
return view('Shop.Admin.Species.view', $data);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$data['specie'] = Species::get($id);
|
|
return view('Shop.Admin.Species.edit', $data);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
return Species::destroy($id);
|
|
}
|
|
|
|
}
|