45 lines
971 B
PHP
45 lines
971 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Shop;
|
|
|
|
use App\Datatables\Admin\Shop\ContentsDataTable;
|
|
use App\Repositories\Shop\Contents;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ContentController extends Controller
|
|
{
|
|
public function index(ContentsDataTable $dataTable)
|
|
{
|
|
return $dataTable->render('Admin.Shop.Contents.list', $data ?? []);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
return view('Admin.Shop.Contents.create', $data ?? []);
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$ret = Contents::store($request->all());
|
|
|
|
return redirect()->route('Admin.Shop.Contents.index');
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
return view('Admin.Shop.Contents.view', $data ?? []);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$data['homepage'] = Contents::get($id);
|
|
|
|
return view('Admin.Shop.Contents.edit', $data);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
return Contents::destroy($id);
|
|
}
|
|
}
|