fixes
This commit is contained in:
@@ -31,14 +31,18 @@ class CustomerAddressController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = CustomerAddresses::get($id);
|
||||
$data = [
|
||||
'customer' => CustomerAddresses::get($id),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.CustomerAddresses.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = CustomerAddresses::edit($id);
|
||||
$data = [
|
||||
'customer' => CustomerAddresses::edit($id),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.CustomerAddresses.edit', $data);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
||||
use App\Datatables\Admin\Shop\CustomerInvoicesDataTable;
|
||||
use App\Datatables\Admin\Shop\CustomerOrdersDataTable;
|
||||
use App\Datatables\Admin\Shop\CustomersDataTable;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -32,17 +34,21 @@ class CustomerController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id);
|
||||
$data = [
|
||||
'customer' => Customers::get($id),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.Customers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Customers::init();
|
||||
$data['customer'] = Customers::edit($id);
|
||||
$model = new CustomerAddressesDataTable();
|
||||
$data['customer_addresses'] = $model->html();
|
||||
$data = Customers::init() + [
|
||||
'customer' => Customers::edit($id),
|
||||
'customer_addresses' => (new CustomerAddressesDataTable())->html(),
|
||||
'customer_invoices' => (new CustomerInvoicesDataTable())->html(),
|
||||
'customer_orders' => (new CustomerOrdersDataTable())->html(),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.Customers.edit', $data);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\CustomerInvoicesDataTable;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
|
||||
class CustomerInvoiceController extends Controller
|
||||
{
|
||||
public function index(CustomerInvoicesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.CustomerInvoices.list');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = [
|
||||
'invoice' => Invoices::get($id),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.CustomerInvoices.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Invoices::destroy($id);
|
||||
}
|
||||
}
|
||||
28
app/Http/Controllers/Admin/Shop/CustomerOrderController.php
Normal file
28
app/Http/Controllers/Admin/Shop/CustomerOrderController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\CustomerOrdersDataTable;
|
||||
use App\Repositories\Shop\Orders;
|
||||
|
||||
class CustomerOrderController extends Controller
|
||||
{
|
||||
public function index(CustomerOrdersDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.CustomerOrders.list');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = [
|
||||
'order' => Orders::get($id),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.CustomerOrders.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Orders::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Shop\PriceListValuesDataTable;
|
||||
use App\Datatables\Admin\Shop\PriceListValuesDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\PriceListValueCategories;
|
||||
use App\Repositories\Shop\PriceListValues;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use App\Repositories\Shop\Unities;
|
||||
@@ -15,27 +14,31 @@ class PriceListValueController extends Controller
|
||||
{
|
||||
public function index(PriceListValuesDataTable $dataTable)
|
||||
{
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
|
||||
return $dataTable->render('Admin.Shop.PriceListValues.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['unities'] = Unities::getOptions();
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
$data = [
|
||||
'unities' => Unities::getOptions(),
|
||||
'taxes_options' => Taxes::getOptions(),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.PriceListValues.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['generic'] = PriceListValues::getFull($id)->toArray();
|
||||
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
||||
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
$priceListValue = PriceListValues::getFull($id)->toArray();
|
||||
$familyId = $priceListValue['category']['article_family_id'];
|
||||
// $packages = Packages::getSelectByFamily($familyId);
|
||||
$data = [
|
||||
'generic' => $priceListValue,
|
||||
'packages' => $packages,
|
||||
'unities' => $packages['id'] ?? false ? Unities::getSelectByPackage($packages['id']) : [],
|
||||
'taxes_options' => Taxes::getOptions(),
|
||||
'categories' => PriceListValueCategories::getOptions(),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.PriceListValues.edit', $data);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Shop\RegisterCustomer;
|
||||
use App\Repositories\Shop\CustomerSaleChannels;
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
@@ -63,10 +64,11 @@ class RegisterController extends Controller
|
||||
|
||||
protected function create(array $data)
|
||||
{
|
||||
$user = Customers::create($data);
|
||||
CustomerAddresses::add($user->id, $data);
|
||||
$customer = Customers::create($data);
|
||||
CustomerAddresses::createByCustomer($customer->id, $data);
|
||||
CustomerSaleChannels::createByCustomer($customer->id);
|
||||
|
||||
return $user;
|
||||
return $customer;
|
||||
}
|
||||
|
||||
protected function guard()
|
||||
|
||||
Reference in New Issue
Block a user