Syncing Of Method With Routes

This commit is contained in:
devansh bawari 2021-01-13 18:30:20 +05:30
parent 27e26d7d35
commit 0283c56df1
10 changed files with 16 additions and 16 deletions

View File

@ -98,7 +98,7 @@ class AddressDataGrid extends DataGrid
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'city',
'label' => trans('admin::app.customers.addresses.city'),
@ -167,7 +167,7 @@ class AddressDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.customers.addresses.delete'),
'action' => route('admin.customer.addresses.massdelete', request('id')),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -150,7 +150,7 @@ class AttributeDataGrid extends DataGrid
'action' => route('admin.catalog.attributes.massdelete'),
'label' => trans('admin::app.datagrid.delete'),
'index' => 'admin_name',
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -78,7 +78,7 @@ class CMSPageDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.datagrid.delete'),
'action' => route('admin.cms.mass-delete'),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -12,7 +12,7 @@ class CartRuleCouponDataGrid extends DataGrid
protected $sortOrder = 'desc';
public function prepareQueryBuilder()
{
{
$route = request()->route() ? request()->route()->getName() : "" ;
$cartRuleId = $route == 'admin.cart-rules.edit' ? collect(request()->segments())->last() : last(explode("/", url()->previous()));
@ -20,7 +20,7 @@ class CartRuleCouponDataGrid extends DataGrid
$queryBuilder = DB::table('cart_rule_coupons')
->addSelect('id', 'code', 'created_at', 'expired_at', 'times_used')
->where('cart_rule_coupons.cart_rule_id', $cartRuleId);
$this->setQueryBuilder($queryBuilder);
}
@ -78,7 +78,7 @@ class CartRuleCouponDataGrid extends DataGrid
'type' => 'delete',
'action' => route('admin.cart-rule-coupons.mass-delete'),
'label' => trans('admin::app.datagrid.delete'),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -107,7 +107,7 @@ class CategoryDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.datagrid.delete'),
'action' => route('admin.catalog.categories.massdelete'),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -160,14 +160,14 @@ class CustomerDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.datagrid.delete'),
'action' => route('admin.customer.mass-delete'),
'method' => 'PUT',
'method' => 'POST',
]);
$this->addMassAction([
'type' => 'update',
'label' => trans('admin::app.datagrid.update-status'),
'action' => route('admin.customer.mass-update'),
'method' => 'PUT',
'method' => 'POST',
'options' => [
'Active' => 1,
'Inactive' => 0,

View File

@ -108,14 +108,14 @@ class CustomerReviewDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.datagrid.delete'),
'action' => route('admin.customer.review.massdelete'),
'method' => 'DELETE',
'method' => 'POST',
]);
$this->addMassAction([
'type' => 'update',
'label' => trans('admin::app.datagrid.update-status'),
'action' => route('admin.customer.review.massupdate'),
'method' => 'PUT',
'method' => 'POST',
'options' => [
trans('admin::app.customers.reviews.pending') => 0,
trans('admin::app.customers.reviews.approved') => 1,

View File

@ -223,14 +223,14 @@ class ProductDataGrid extends DataGrid
'type' => 'delete',
'label' => trans('admin::app.datagrid.delete'),
'action' => route('admin.catalog.products.massdelete'),
'method' => 'DELETE',
'method' => 'POST',
]);
$this->addMassAction([
'type' => 'update',
'label' => trans('admin::app.datagrid.update-status'),
'action' => route('admin.catalog.products.massupdate'),
'method' => 'PUT',
'method' => 'POST',
'options' => [
'Active' => 1,
'Inactive' => 0,

View File

@ -104,7 +104,7 @@ class CategoryDataGrid extends DataGrid
'type' => 'delete',
'action' => route('velocity.admin.category.mass-delete'),
'label' => trans('admin::app.datagrid.delete'),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}

View File

@ -116,7 +116,7 @@ class ContentDataGrid extends DataGrid
'type' => 'delete',
'action' => route('velocity.admin.content.mass-delete'),
'label' => trans('admin::app.datagrid.delete'),
'method' => 'DELETE',
'method' => 'POST',
]);
}
}