original_string: public function position(OrderUpdateRequest $request, $id)
      {
          $record  = $this->modelRepository->findOrFail($id);
          $success = false;
          $result  = null;
  
          if ($this->getModelInformation()->list->orderable) {
              $success = true;
              $result  = $this->changeModelOrderablePosition($record, $request->get('position'));
          }
  
          if ($success && config('cms-models.notifications.flash.position')) {
              cms_flash(
                  cms_trans(
                      'models.store.success-message-position',
                      [ 'record' => $this->getSimpleRecordReference($id, $record) ]
                  ),
                  FlashLevel::SUCCESS
              );
          }
  
          event( new Events\ModelPositionUpdatedInCms($record) );
  
          if (request()->ajax()) {
              return response()->json([ 'success' => $success, 'position' => $result ]);
          }
  
          return redirect()->back();
      }
code: public function position(OrderUpdateRequest $request, $id)
      {
          $record  = $this->modelRepository->findOrFail($id);
          $success = false;
          $result  = null;
  
          if ($this->getModelInformation()->list->orderable) {
              $success = true;
              $result  = $this->changeModelOrderablePosition($record, $request->get('position'));
          }
  
          if ($success && config('cms-models.notifications.flash.position')) {
              cms_flash(
                  cms_trans(
                      'models.store.success-message-position',
                      [ 'record' => $this->getSimpleRecordReference($id, $record) ]
                  ),
                  FlashLevel::SUCCESS
              );
          }
  
          event( new Events\ModelPositionUpdatedInCms($record) );
  
          if (request()->ajax()) {
              return response()->json([ 'success' => $success, 'position' => $result ]);
          }
  
          return redirect()->back();
      }
code_tokens: public function position ( OrderUpdateRequest $ request , $ id ) { $ record = $ this -> modelRepository -> findOrFail ( $ id ) ; $ success = false ; $ result = null ; if ( $ this -> getModelInformation ( ) -> list -> orderable ) { $ success = true ; $ result = $ this -> changeModelOrderablePosition ( $ record , $ request -> get ( 'position' ) ) ; } if ( $ success && config ( 'cms-models.notifications.flash.position' ) ) { cms_flash ( cms_trans ( 'models.store.success-message-position' , [ 'record' => $ this -> getSimpleRecordReference ( $ id , $ record ) ] ) , FlashLevel :: SUCCESS ) ; } event ( new Events \ ModelPositionUpdatedInCms ( $ record ) ) ; if ( request ( ) -> ajax ( ) ) { return response ( ) -> json ( [ 'success' => $ success , 'position' => $ result ] ) ; } return redirect ( ) -> back ( ) ; }
docstring: Changes orderable position for a record.
  
  @param OrderUpdateRequest $request
  @param int                $id
  @return mixed
  @event ModelPositionUpdatedInCms
docstring_tokens: Changes orderable position for a record .