Cloning products

This commit is contained in:
Hillel Coren 2018-03-20 13:54:24 +02:00
parent 4aa8abdbee
commit ec7b4fe393
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class ProductController extends BaseController
* *
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function edit($publicId, $clone = false) public function edit(ProductRequest $request, $publicId, $clone = false)
{ {
$account = Auth::user()->account; $account = Auth::user()->account;
$product = Product::scope($publicId)->withTrashed()->firstOrFail(); $product = Product::scope($publicId)->withTrashed()->firstOrFail();

View File

@ -71,7 +71,7 @@ class ProductDatatable extends EntityDatatable
[ [
trans('texts.clone_product'), trans('texts.clone_product'),
function ($model) { function ($model) {
return "javascript:submitForm_product('clone', {$model->public_id})"; return URL::to("products/{$model->public_id}/clone");
}, },
function ($model) { function ($model) {
return Auth::user()->can('create', ENTITY_PRODUCT); return Auth::user()->can('create', ENTITY_PRODUCT);