[WIP] Refactor project
This commit is contained in:
@@ -2,85 +2,46 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use App\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
public function index(CustomersDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
return $dataTable->render('Shop.Admin.Customers.list', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.Customers.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Customers::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Customers.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Customer $customer)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id);
|
||||
return view('Shop.Admin.Customers.view', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Customer $customer)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id)->toArray();
|
||||
return view('Shop.Admin.Customers.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Customer $customer)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function destroy($id)
|
||||
{
|
||||
return Customers::destroy($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Customer $customer)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user