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