Add homepage

This commit is contained in:
Ludovic CANDELLIER
2022-03-30 22:23:57 +02:00
parent 7187a312eb
commit e3c60e7cde
27 changed files with 1200 additions and 2549 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers\Admin\Shop;
use Illuminate\Http\Request;
use App\Repositories\Shop\Homepages;
use App\Datatables\Shop\HomepagesDataTable;
class HomepageController extends Controller
{
public function index(HomepagesDataTable $dataTable)
{
$data = [];
return $dataTable->render('Admin.Shop.Homepages.list', $data);
}
public function create()
{
return view('Admin.Shop.Homepages.create', $data ?? []);
}
public function store(Request $request)
{
$ret = Homepages::store($request->all());
return redirect()->route('Admin.Shop.Homepages.index');
}
public function show($id)
{
return view('Admin.Shop.Homepages.view', $data ?? []);
}
public function edit($id)
{
$data['homepage'] = Homepages::edit($id);
return view('Admin.Shop.Homepages.edit', $data);
}
public function destroy($id)
{
return Homepages::destroy($id);
}
}