Add new version in repository
This commit is contained in:
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
public function index(CustomersDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Customers.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Customers::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Customers.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id);
|
||||
return view('Admin.Shop.Customers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id)->toArray();
|
||||
return view('Admin.Shop.Customers.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Customers::destroy($id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user