rename models and associates, isolate botanic with shop
This commit is contained in:
52
app/Http/Controllers/Botanic/Admin/GenreController.php
Normal file
52
app/Http/Controllers/Botanic/Admin/GenreController.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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\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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user