53 lines
1.2 KiB
PHP
53 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\Genres;
|
|
use App\Repositories\Botanic\Families;
|
|
use App\DataTables\Botanic\GenresDataTable;
|
|
|
|
class GenreController extends Controller
|
|
{
|
|
public function index(GenresDataTable $dataTable)
|
|
{
|
|
return $dataTable->render('Botanic.Admin.Genres.list');
|
|
}
|
|
|
|
public function getDatatable(Request $request)
|
|
{
|
|
return Genres::getDataTable($request->all());
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
return view('Botanic.Admin.Genres.create');
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$ret = Genres::store($request);
|
|
return redirect()->route('Botanic.Admin.Genres.index');
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
$data = Genres::get($id);
|
|
return view('Botanic.Admin.Genres.view', $data);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$data = Genres::get($id);
|
|
$data['families'] = Families::getOptions();
|
|
return view('Botanic.Admin.Genres.edit', $data);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
return Genres::destroy($id);
|
|
}
|
|
}
|