Add varieties
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Genres;
|
||||
use App\Repositories\Shop\Families;
|
||||
use App\DataTables\GenresDataTable;
|
||||
|
||||
class GenreController extends Controller
|
||||
@@ -39,7 +40,8 @@ class GenreController extends Controller
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['genre'] = Genres::get($id);
|
||||
$data = Genres::get($id);
|
||||
$data['families'] = Families::getOptions();
|
||||
return view('Shop.Admin.Genres.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Species;
|
||||
use App\Repositories\Shop\Genres;
|
||||
use App\DataTables\SpeciesDataTable;
|
||||
|
||||
class SpecieController extends Controller
|
||||
@@ -39,7 +40,8 @@ class SpecieController extends Controller
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['specie'] = Species::get($id);
|
||||
$data = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Shop.Admin.Species.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
53
app/Http/Controllers/Shop/Admin/VarietyController.php
Normal file
53
app/Http/Controllers/Shop/Admin/VarietyController.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Varieties;
|
||||
use App\Repositories\Shop\Species;
|
||||
use App\DataTables\VarietiesDataTable;
|
||||
|
||||
class VarietyController extends Controller
|
||||
{
|
||||
public function index(VarietiesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Varieties.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Varieties::getDatatable($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.Varieties.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Varieties::store($request);
|
||||
return redirect()->route('Shop.Admin.Varieties.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Varieties::get($id);
|
||||
return view('Shop.Admin.Varieties.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Varieties::get($id);
|
||||
$data['species'] = Species::getOptions();
|
||||
return view('Shop.Admin.Varieties.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Varieties::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user