[WIP] Admin for Families, Genres and Species
This commit is contained in:
@@ -5,23 +5,14 @@ namespace App\Http\Controllers\Shop\Admin;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Species;
|
||||
use App\Repositories\Shop\Species;
|
||||
use App\DataTables\SpeciesDataTable;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(SpeciesDataTable $dataTable)
|
||||
{
|
||||
if ($request->ajax()) {
|
||||
return self::getDatatable($request);
|
||||
} else {
|
||||
$data = [];
|
||||
return view('Shop.Admin.Species.list', $data);
|
||||
}
|
||||
return $dataTable->render('Shop.Admin.Species.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -29,73 +20,32 @@ class SpecieController extends Controller
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
return view('Shop.Admin.Species.create', $data);
|
||||
return view('Shop.Admin.Species.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Species::store($request);
|
||||
return redirect()->route('Shop.Admin.Species.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Shop.Admin.Species.view', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
$data['specie'] = Species::get($id);
|
||||
return view('Shop.Admin.Species.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user