Merge branch 'master' of https://github.com/bagisto/bagisto into development
This commit is contained in:
commit
75ef9cd530
|
|
@ -36,40 +36,75 @@ return [
|
|||
'name' => 'admin::app.acl.products',
|
||||
'route' => 'admin.catalog.products.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'catalog.products.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.catalog.products.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'catalog.categories',
|
||||
'name' => 'admin::app.acl.categories',
|
||||
'route' => 'admin.catalog.categories.index',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'catalog.categories.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.catalog.categories.edit',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'catalog.attributes',
|
||||
'name' => 'admin::app.acl.attributes',
|
||||
'route' => 'admin.catalog.attributes.index',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'catalog.attributes.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.catalog.attributes.edit',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'catalog.families',
|
||||
'name' => 'admin::app.acl.attribute-families',
|
||||
'route' => 'admin.catalog.families.index',
|
||||
'sort' => 4
|
||||
], [
|
||||
'key' => 'catalog.families.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.catalog.families.edit',
|
||||
'sort' => 4
|
||||
], [
|
||||
'key' => 'customers',
|
||||
'name' => 'admin::app.acl.customers',
|
||||
'route' => 'admin.customers.index',
|
||||
'route' => 'admin.customer.index',
|
||||
'sort' => 4
|
||||
], [
|
||||
'key' => 'customers.customers',
|
||||
'name' => 'admin::app.acl.customers',
|
||||
'route' => 'admin.customers.index',
|
||||
'route' => 'admin.customer.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'customers.customers.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.customer.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'customers.groups',
|
||||
'name' => 'admin::app.acl.groups',
|
||||
'route' => 'admin.groups.index',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'customers.groups.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.groups.edit',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'customers.reviews',
|
||||
'name' => 'admin::app.acl.reviews',
|
||||
'route' => 'admin.customers.reviews.index',
|
||||
'route' => 'admin.customer.review.index',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'customers.reviews.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.customer.review.edit',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'configuration',
|
||||
|
|
@ -86,26 +121,51 @@ return [
|
|||
'name' => 'admin::app.acl.locales',
|
||||
'route' => 'admin.locales.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.locales.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.locales.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.currencies',
|
||||
'name' => 'admin::app.acl.currencies',
|
||||
'route' => 'admin.currencies.index',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'settings.currencies.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.currencies.edit',
|
||||
'sort' => 2
|
||||
], [
|
||||
'key' => 'settings.exchange_rates',
|
||||
'name' => 'admin::app.acl.exchange-rates',
|
||||
'route' => 'admin.exchange_rates.index',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'settings.exchange_rates.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.exchange_rates.edit',
|
||||
'sort' => 3
|
||||
], [
|
||||
'key' => 'settings.inventory_sources',
|
||||
'name' => 'admin::app.acl.inventory-sources',
|
||||
'route' => 'admin.inventory_sources.index',
|
||||
'sort' => 4
|
||||
], [
|
||||
'key' => 'settings.inventory_sources.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.inventory_sources.edit',
|
||||
'sort' => 4
|
||||
], [
|
||||
'key' => 'settings.channels',
|
||||
'name' => 'admin::app.acl.channels',
|
||||
'route' => 'admin.channels.index',
|
||||
'sort' => 5
|
||||
], [
|
||||
'key' => 'settings.channels.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.channels.edit',
|
||||
'sort' => 5
|
||||
], [
|
||||
'key' => 'settings.users',
|
||||
'name' => 'admin::app.acl.users',
|
||||
|
|
@ -116,16 +176,31 @@ return [
|
|||
'name' => 'admin::app.acl.users',
|
||||
'route' => 'admin.users.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.users.users.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.users.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.users.roles',
|
||||
'name' => 'admin::app.acl.roles',
|
||||
'route' => 'admin.roles.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.users.roles.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.roles.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.sliders',
|
||||
'name' => 'admin::app.acl.sliders',
|
||||
'route' => 'admin.sliders.index',
|
||||
'sort' => 7
|
||||
], [
|
||||
'key' => 'settings.sliders.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.sliders.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.taxes',
|
||||
'name' => 'admin::app.acl.taxes',
|
||||
|
|
@ -136,11 +211,21 @@ return [
|
|||
'name' => 'admin::app.acl.tax-categories',
|
||||
'route' => 'admin.tax-categories.index',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.taxes.tax-categories.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.tax-categories.edit',
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.taxes.tax-rates',
|
||||
'name' => 'admin::app.acl.tax-rates',
|
||||
'route' => 'admin.tax-rates.index',
|
||||
'sort' => 2
|
||||
'sort' => 1
|
||||
], [
|
||||
'key' => 'settings.taxes.tax-rates.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.tax-rates.edit',
|
||||
'sort' => 1
|
||||
]
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ConfigurationController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\CoreConfigRepository $coreConfig
|
||||
* @param \Webkul\Core\Repositories\CoreConfigRepository $coreConfig
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CoreConfig $coreConfig)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class CustomerController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$customer = $this->customer->findOneWhere(['id'=>$id]);
|
||||
$customer = $this->customer->findOrFail($id);
|
||||
|
||||
$customerGroup = $this->customerGroup->all();
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ class CustomerController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->customer->delete($id);
|
||||
$this->customer->findOrFail($id)->delete();
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer']));
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class CustomerGroupController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Customer\Repositories\CustomerGroupRepository as customerGroup;
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository as customerGroup;
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CustomerGroup $customerGroup)
|
||||
|
|
@ -94,7 +94,7 @@ class CustomerGroupController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$group = $this->customerGroup->findOneWhere(['id'=>$id]);
|
||||
$group = $this->customerGroup->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('group'));
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ class CustomerGroupController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$group = $this->customerGroup->findOneByField('id', $id);
|
||||
$group = $this->customerGroup->findOrFail($id);
|
||||
|
||||
if ($group->is_user_defined == 0) {
|
||||
session()->flash('warning', trans('admin::app.customers.customers.group-default'));
|
||||
|
|
|
|||
|
|
@ -54,28 +54,28 @@ class DashboardController extends Controller
|
|||
* @var array
|
||||
*/
|
||||
protected $productInventory;
|
||||
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $startDate;
|
||||
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $lastStartDate;
|
||||
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $endDate;
|
||||
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
|
|
@ -86,10 +86,10 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param Webkul\Sales\Repositories\OrderItemRepository $orderItem
|
||||
* @param Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param Webkul\Product\Repositories\ProductInventoryRepository $productInventory
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItem
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventory
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -188,7 +188,7 @@ class DashboardController extends Controller
|
|||
return $query->where('orders.created_at', '>=', $interval['start'])
|
||||
->where('orders.created_at', '<=', $interval['end']);
|
||||
})->sum('base_grand_total');
|
||||
|
||||
|
||||
$statistics['sale_graph']['total'][] = $total;
|
||||
$statistics['sale_graph']['formated_total'][] = core()->formatBasePrice($total);
|
||||
}
|
||||
|
|
@ -283,11 +283,11 @@ class DashboardController extends Controller
|
|||
*/
|
||||
public function setStartEndDate()
|
||||
{
|
||||
$this->startDate = request()->get('start')
|
||||
$this->startDate = request()->get('start')
|
||||
? Carbon::createFromTimeString(request()->get('start') . " 00:00:01")
|
||||
: Carbon::createFromTimeString(Carbon::now()->subDays(30)->format('Y-m-d') . " 00:00:01");
|
||||
|
||||
$this->endDate = request()->get('end')
|
||||
$this->endDate = request()->get('end')
|
||||
? Carbon::createFromTimeString(request()->get('end') . " 23:59:59")
|
||||
: Carbon::now();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,17 +44,17 @@ class ExportController extends Controller
|
|||
|
||||
$proceed = false;
|
||||
|
||||
foreach($this->exportableGrids as $exportableGrid) {
|
||||
if(last($gridName) == $exportableGrid) {
|
||||
foreach ($this->exportableGrids as $exportableGrid) {
|
||||
if (last($gridName) == $exportableGrid) {
|
||||
$proceed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(! $proceed) {
|
||||
if (! $proceed) {
|
||||
return redirect()->back();
|
||||
}
|
||||
$gridInstance = new $path;
|
||||
|
||||
$gridInstance = new $path;
|
||||
$records = $gridInstance->export();
|
||||
|
||||
if (count($records) == 0) {
|
||||
|
|
@ -66,14 +66,13 @@ class ExportController extends Controller
|
|||
if ($format == 'csv') {
|
||||
return Excel::download(new DataGridExport($records), last($gridName).'.csv');
|
||||
}
|
||||
|
||||
if ($format == 'xls') {
|
||||
return Excel::download(new DataGridExport($records), last($gridName).'.xlsx');
|
||||
}
|
||||
|
||||
session()->flash('warning', trans('admin::app.export.illegal-format'));
|
||||
|
||||
return redirect()->back();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -41,8 +41,8 @@ class InvoiceController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param Webkul\Sales\Repositories\InvoiceRepository $invoice
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param \Webkul\Sales\Repositories\InvoiceRepository $invoice
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Order $order)
|
||||
|
|
@ -75,7 +75,7 @@ class InvoiceController extends Controller
|
|||
*/
|
||||
public function create($orderId)
|
||||
{
|
||||
$order = $this->order->find($orderId);
|
||||
$order = $this->order->findOrFail($orderId);
|
||||
|
||||
return view($this->_config['view'], compact('order'));
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ class InvoiceController extends Controller
|
|||
*/
|
||||
public function store(Request $request, $orderId)
|
||||
{
|
||||
$order = $this->order->find($orderId);
|
||||
$order = $this->order->findOrFail($orderId);
|
||||
|
||||
if (! $order->canInvoice()) {
|
||||
session()->flash('error', trans('admin::app.sales.invoices.creation-error'));
|
||||
|
|
@ -132,7 +132,7 @@ class InvoiceController extends Controller
|
|||
*/
|
||||
public function view($id)
|
||||
{
|
||||
$invoice = $this->invoice->find($id);
|
||||
$invoice = $this->invoice->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('invoice'));
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ class InvoiceController extends Controller
|
|||
*/
|
||||
public function print($id)
|
||||
{
|
||||
$invoice = $this->invoice->find($id);
|
||||
$invoice = $this->invoice->findOrFail($id);
|
||||
|
||||
$pdf = PDF::loadView('admin::sales.invoices.pdf', compact('invoice'))->setPaper('a4');
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class OrderController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Order $order)
|
||||
|
|
@ -63,7 +63,7 @@ class OrderController extends Controller
|
|||
*/
|
||||
public function view($id)
|
||||
{
|
||||
$order = $this->order->find($id);
|
||||
$order = $this->order->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('order'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ class ShipmentController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\ShipmentRepository $shipment
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param Webkul\Sales\Repositories\OrderitemRepository $orderItem
|
||||
* @param \Webkul\Sales\Repositories\ShipmentRepository $shipment
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $order
|
||||
* @param \Webkul\Sales\Repositories\OrderitemRepository $orderItem
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -89,7 +89,7 @@ class ShipmentController extends Controller
|
|||
*/
|
||||
public function create($orderId)
|
||||
{
|
||||
$order = $this->order->find($orderId);
|
||||
$order = $this->order->findOrFail($orderId);
|
||||
|
||||
if (! $order->channel || !$order->canShip()) {
|
||||
session()->flash('error', trans('admin::app.sales.shipments.creation-error'));
|
||||
|
|
@ -109,7 +109,7 @@ class ShipmentController extends Controller
|
|||
*/
|
||||
public function store(Request $request, $orderId)
|
||||
{
|
||||
$order = $this->order->find($orderId);
|
||||
$order = $this->order->findOrFail($orderId);
|
||||
|
||||
if (! $order->canShip()) {
|
||||
session()->flash('error', trans('admin::app.sales.shipments.order-error'));
|
||||
|
|
@ -182,7 +182,7 @@ class ShipmentController extends Controller
|
|||
*/
|
||||
public function view($id)
|
||||
{
|
||||
$shipment = $this->shipment->find($id);
|
||||
$shipment = $this->shipment->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('shipment'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ return [
|
|||
'taxes' => 'الضرائب',
|
||||
'tax-categories' => 'فئات الضرائب',
|
||||
'tax-rates' => 'المعدلات الضريبية',
|
||||
'edit' => 'Edit',
|
||||
],
|
||||
'dashboard' => [
|
||||
'title' => 'لوحة العدادات',
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ return [
|
|||
'taxes' => 'Taxes',
|
||||
'tax-categories' => 'Tax Categories',
|
||||
'tax-rates' => 'Tax Rates',
|
||||
'edit' => 'Edit',
|
||||
],
|
||||
|
||||
'dashboard' => [
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ return [
|
|||
'taxes' => 'Impostos',
|
||||
'tax-categories' => 'Categorias de Impostos',
|
||||
'tax-rates' => 'Impostos de Impostos',
|
||||
'edit' => 'Edit',
|
||||
],
|
||||
|
||||
'dashboard' => [
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class AttributeController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attribute
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attribute
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Attribute $attribute)
|
||||
|
|
@ -94,7 +94,7 @@ class AttributeController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$attribute = $this->attribute->find($id);
|
||||
$attribute = $this->attribute->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('attribute'));
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ class AttributeController extends Controller
|
|||
|
||||
$attribute = $this->attribute->findOrFail($id);
|
||||
|
||||
if(!$attribute->is_user_defined) {
|
||||
if (! $attribute->is_user_defined) {
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
} else {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AttributeFamilyController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
|
||||
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AttributeFamily $attributeFamily)
|
||||
|
|
@ -96,7 +96,7 @@ class AttributeFamilyController extends Controller
|
|||
*/
|
||||
public function edit(Attribute $attribute, $id)
|
||||
{
|
||||
$attributeFamily = $this->attributeFamily->with(['attribute_groups.custom_attributes'])->find($id, ['*']);
|
||||
$attributeFamily = $this->attributeFamily->with(['attribute_groups.custom_attributes'])->findOrFail($id, ['*']);
|
||||
|
||||
$custom_attributes = $attribute->all(['id', 'code', 'admin_name', 'type']);
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class AttributeFamilyController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$attributeFamily = $this->attributeFamily->find($id);
|
||||
$attributeFamily = $this->attributeFamily->findOrFail($id);
|
||||
|
||||
if ($this->attributeFamily->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Family']));
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class CategoryController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Category $category)
|
||||
|
|
@ -108,7 +108,7 @@ class CategoryController extends Controller
|
|||
{
|
||||
$categories = $this->category->getCategoryTree($id);
|
||||
|
||||
$category = $this->category->find($id);
|
||||
$category = $this->category->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('category', 'categories'));
|
||||
}
|
||||
|
|
@ -151,7 +151,9 @@ class CategoryController extends Controller
|
|||
{
|
||||
Event::fire('catalog.category.delete.before', $id);
|
||||
|
||||
if(strtolower($this->category->find($id)->name) == "root") {
|
||||
$category = $this->category->findOrFail($id);
|
||||
|
||||
if (strtolower($this->category->find($id)->name) == "root") {
|
||||
session()->flash('warning', trans('admin::app.response.delete-category-root', ['name' => 'Category']));
|
||||
} else {
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ChannelController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\ChannelRepository $channel
|
||||
* @param \Webkul\Core\Repositories\ChannelRepository $channel
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Channel $channel)
|
||||
|
|
@ -100,7 +100,7 @@ class ChannelController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$channel = $this->channel->with(['locales', 'currencies'])->find($id);
|
||||
$channel = $this->channel->with(['locales', 'currencies'])->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('channel'));
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ class ChannelController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$channel = $this->channel->find($id);
|
||||
$channel = $this->channel->findOrFail($id);
|
||||
|
||||
if ($channel->code == config('app.channel')) {
|
||||
session()->flash('error', trans('admin::app.response.cannot-delete-default', ['name' => 'Channel']));
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class CountryStateController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\CountryRepository $country
|
||||
* @param \Webkul\Core\Repositories\CountryRepository $country
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Country $country, State $state)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class CurrencyController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\CurrencyRepository $currency
|
||||
* @param \Webkul\Core\Repositories\CurrencyRepository $currency
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Currency $currency)
|
||||
|
|
@ -94,7 +94,7 @@ class CurrencyController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$currency = $this->currency->find($id);
|
||||
$currency = $this->currency->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('currency'));
|
||||
}
|
||||
|
|
@ -139,7 +139,7 @@ class CurrencyController extends Controller
|
|||
|
||||
Event::fire('core.currency.delete.after', $id);
|
||||
|
||||
if($result)
|
||||
if ($result)
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Currency']));
|
||||
else
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Currency']));
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ class ExchangeRateController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\ExchangeRateRepository $exchangeRate
|
||||
* @param Webkul\Core\Repositories\CurrencyRepository $currency
|
||||
* @param \Webkul\Core\Repositories\ExchangeRateRepository $exchangeRate
|
||||
* @param \Webkul\Core\Repositories\CurrencyRepository $currency
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ExchangeRate $exchangeRate, Currency $currency)
|
||||
|
|
@ -109,7 +109,7 @@ class ExchangeRateController extends Controller
|
|||
{
|
||||
$currencies = $this->currency->all();
|
||||
|
||||
$exchangeRate = $this->exchangeRate->find($id);
|
||||
$exchangeRate = $this->exchangeRate->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('currencies', 'exchangeRate'));
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ class ExchangeRateController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
if($this->exchangeRate->count() == 1) {
|
||||
if ($this->exchangeRate->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Exchange rate']));
|
||||
} else {
|
||||
Event::fire('core.exchange_rate.delete.before', $id);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class LocaleController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\LocaleRepository $locale
|
||||
* @param \Webkul\Core\Repositories\LocaleRepository $locale
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Locale $locale)
|
||||
|
|
@ -94,7 +94,7 @@ class LocaleController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$locale = $this->locale->find($id);
|
||||
$locale = $this->locale->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('locale'));
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ class LocaleController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
if($this->locale->count() == 1) {
|
||||
if ($this->locale->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Locale']));
|
||||
} else {
|
||||
Event::fire('core.locale.delete.before', $id);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SliderController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\SliderRepository $slider
|
||||
* @param \Webkul\Core\Repositories\SliderRepository $slider
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Slider $slider)
|
||||
|
|
@ -97,7 +97,7 @@ class SliderController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$slider = $this->slider->find($id);
|
||||
$slider = $this->slider->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'])->with('slider', $slider);
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ class SliderController extends Controller
|
|||
if ($this->slider->findWhere(['channel_id' => core()->getCurrentChannel()->id])->count() == 1) {
|
||||
session()->flash('warning', trans('admin::app.settings.sliders.delete-success'));
|
||||
} else {
|
||||
$this->slider->destroy($id);
|
||||
$this->slider->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.sliders.delete-fail'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SubscriptionController extends Controller
|
|||
* @return mixed
|
||||
*/
|
||||
public function edit($id) {
|
||||
$subscriber = $this->subscribers->findOneByField('id', $id);
|
||||
$subscriber = $this->subscribers->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'])->with('subscriber', $subscriber);
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ class SubscriptionController extends Controller
|
|||
public function update($id) {
|
||||
$data = request()->all();
|
||||
|
||||
$subscriber = $this->subscribers->findOneByField('id', $id);
|
||||
$subscriber = $this->subscribers->findOrFail($id);
|
||||
|
||||
$result = $subscriber->update($data);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class AddressController extends Controller
|
|||
$data['default_address'] = 1;
|
||||
}
|
||||
|
||||
if($this->address->create($data)) {
|
||||
if ($this->address->create($data)) {
|
||||
session()->flash('success', trans('shop::app.customer.account.address.create.success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* Create a new Repository instance.
|
||||
*
|
||||
* @param Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class OrderController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Order\Repositories\OrderRepository $order
|
||||
* @param Webkul\Order\Repositories\InvoiceRepository $invoice
|
||||
* @param \Webkul\Order\Repositories\OrderRepository $order
|
||||
* @param \Webkul\Order\Repositories\InvoiceRepository $invoice
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class InventorySourceController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
|
||||
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(InventorySource $inventorySource)
|
||||
|
|
@ -105,7 +105,7 @@ class InventorySourceController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$inventorySource = $this->inventorySource->find($id);
|
||||
$inventorySource = $this->inventorySource->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('inventorySource'));
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ class InventorySourceController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
if($this->inventorySource->count() == 1) {
|
||||
if ($this->inventorySource->count() == 1) {
|
||||
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Inventory source']));
|
||||
} else {
|
||||
Event::fire('inventory.inventory_source.delete.before', $id);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class StandardController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Attribute\Repositories\OrderRepository $orderRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
|
||||
* @param Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @param Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $product
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -167,7 +167,7 @@ class ProductController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$product = $this->product->with(['variants'])->find($id);
|
||||
$product = $this->product->with(['variants'])->findOrFail($id);
|
||||
|
||||
$categories = $this->category->getCategoryTree();
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ class ProductController extends Controller
|
|||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->product->delete($id);
|
||||
$this->product->findOrFail($id)->delete();
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Product']));
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ class ProductController extends Controller
|
|||
foreach ($productIds as $productId) {
|
||||
$product = $this->product->find($productId);
|
||||
|
||||
if(isset($product)) {
|
||||
if (isset($product)) {
|
||||
$this->product->delete($productId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ class ReviewController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product, ProductReview $productReview)
|
||||
|
|
@ -72,7 +72,7 @@ class ReviewController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$review = $this->productReview->find($id);
|
||||
$review = $this->productReview->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'],compact('review'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class CategoryController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $category
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $product
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Category $category, Product $product)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class OnepageController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Attribute\Repositories\OrderRepository $orderRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(OrderRepository $orderRepository)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $product
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( Product $product)
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ class ReviewController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product, ProductReview $productReview)
|
||||
|
|
@ -123,7 +123,7 @@ class ReviewController extends Controller
|
|||
|
||||
if ($reviews->count() > 0) {
|
||||
foreach ($reviews as $review) {
|
||||
if($review->id == $id) {
|
||||
if ($review->id == $id) {
|
||||
$this->productReview->delete($id);
|
||||
|
||||
session()->flash('success', trans('shop::app.response.delete-success', ['name' => 'Product Review']));
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ class TaxCategoryController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Tax\Repositories\TaxCategoryRepository $taxCategory
|
||||
* @param Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @param Webkul\Tax\Repositories\TaxMapRepository $taxMap
|
||||
* @param \Webkul\Tax\Repositories\TaxCategoryRepository $taxCategory
|
||||
* @param \Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @param \Webkul\Tax\Repositories\TaxMapRepository $taxMap
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ class TaxController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Core\Repositories\ChannelRepository $channel
|
||||
* @param Webkul\Tax\Repositories\TaxCategoryRepository $taxCategory
|
||||
* @param Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @param Webkul\Tax\Repositories\TaxMapRepository $taxMap
|
||||
* @param \Webkul\Core\Repositories\ChannelRepository $channel
|
||||
* @param \Webkul\Tax\Repositories\TaxCategoryRepository $taxCategory
|
||||
* @param \Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @param \Webkul\Tax\Repositories\TaxMapRepository $taxMap
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Channel $channel, TaxCategory $taxCategory, TaxRate $taxRate, TaxMap $taxMap)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class TaxRateController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @param \Webkul\Tax\Repositories\TaxRateRepository $taxRate
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TaxRate $taxRate)
|
||||
|
|
@ -114,7 +114,7 @@ class TaxRateController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$taxRate = $this->taxRate->find($id);
|
||||
$taxRate = $this->taxRate->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'])->with('taxRate', $taxRate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class RoleController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\User\Repositories\RoleRepository $role
|
||||
* @param \Webkul\User\Repositories\RoleRepository $role
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Role $role)
|
||||
|
|
@ -96,7 +96,7 @@ class RoleController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$role = $this->role->find($id);
|
||||
$role = $this->role->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('role'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class UserController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\User\Repositories\AdminRepository $admin
|
||||
* @param Webkul\User\Repositories\RoleRepository $role
|
||||
* @param \Webkul\User\Repositories\AdminRepository $admin
|
||||
* @param \Webkul\User\Repositories\RoleRepository $role
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Admin $admin, Role $role)
|
||||
|
|
@ -111,7 +111,7 @@ class UserController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$user = $this->admin->find($id);
|
||||
$user = $this->admin->findOrFail($id);
|
||||
|
||||
$roles = $this->role->all();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue