public function destroy(OperationType $operationType)
 {
     if (is_integer($operationType)) {
         $operationType = OperationType::find($operationType);
     }
     $operationType->delete();
     Flash::success('OperationType has been created Deleted!');
     return Redirect::back();
 }
 public function edit(Share $share)
 {
     $users = User::select(\DB::raw("CONCAT(surname, ' ', name) AS full_name, id"))->lists("full_name", "id");
     $currencies = Currency::select(\DB::raw("CONCAT(name, ' ', symbol) AS full_name, id"))->lists("full_name", "id");
     $accounts = Account::lists("name", "id");
     $shares = Share::select(\DB::raw("CONCAT(name, ' ', type) AS full_name, id"))->lists("full_name", "id");
     $operationTypes = OperationType::lists("name", "id");
     $vehicles = Vehicle::lists("name", "id");
     return View::make('Middle.Web.Share.edit', compact(['share', 'users', 'currencies', 'accounts', 'shares', 'operationTypes', 'vehicles']));
 }
 public function destroy($operationType)
 {
     $operationType = OperationType::find($operationType);
     $operationType->delete();
     return response(['data' => true, 'status' => 'success', 'message' => 'successfully deleted']);
 }