more enable/disable

This commit is contained in:
denisdulici
2018-06-11 11:53:45 +03:00
parent f3e54217fc
commit 7f28b00570
11 changed files with 269 additions and 6 deletions

View File

@ -278,6 +278,44 @@ class Customers extends Controller
return redirect('incomes/customers');
}
/**
* Enable the specified resource.
*
* @param Customer $customer
*
* @return Response
*/
public function enable(Customer $customer)
{
$customer->enabled = 1;
$customer->save();
$message = trans('messages.success.enabled', ['type' => trans_choice('general.customers', 1)]);
flash($message)->success();
return redirect()->route('customers.index');
}
/**
* Disable the specified resource.
*
* @param Customer $customer
*
* @return Response
*/
public function disable(Customer $customer)
{
$customer->enabled = 0;
$customer->save();
$message = trans('messages.success.disabled', ['type' => trans_choice('general.customers', 1)]);
flash($message)->success();
return redirect()->route('customers.index');
}
/**
* Remove the specified resource from storage.
*