original_string: protected function setDefaultRowActions()
      {
          $actions = $this->info->list->default_action ?: [];
  
          if (count($actions)) {
              return $this;
          }
  
          $addEditAction = config('cms-models.defaults.default-listing-action-edit', false);
          $addShowAction = config('cms-models.defaults.default-listing-action-show', false);
  
          if ( ! $addEditAction && ! $addShowAction) {
              return $this;
          }
  
          // The edit and/or show action should be set as default index row click action.
  
          $modelSlug        = $this->getRouteHelper()->getRouteSlugForModelClass(get_class($this->model));
          $permissionPrefix = $this->getRouteHelper()->getPermissionPrefixForModelSlug($modelSlug);
  
          if ($addEditAction) {
              $actions[] = [
                  'strategy'    => ActionReferenceType::EDIT,
                  'permissions' => "{$permissionPrefix}edit",
              ];
          }
  
          if ($addShowAction) {
              $actions[] = [
                  'strategy'    => ActionReferenceType::SHOW,
                  'permissions' => "{$permissionPrefix}show",
              ];
          }
  
          $this->info->list->default_action = $actions;
  
          return $this;
      }
code: protected function setDefaultRowActions()
      {
          $actions = $this->info->list->default_action ?: [];
  
          if (count($actions)) {
              return $this;
          }
  
          $addEditAction = config('cms-models.defaults.default-listing-action-edit', false);
          $addShowAction = config('cms-models.defaults.default-listing-action-show', false);
  
          if ( ! $addEditAction && ! $addShowAction) {
              return $this;
          }
  
          // The edit and/or show action should be set as default index row click action.
  
          $modelSlug        = $this->getRouteHelper()->getRouteSlugForModelClass(get_class($this->model));
          $permissionPrefix = $this->getRouteHelper()->getPermissionPrefixForModelSlug($modelSlug);
  
          if ($addEditAction) {
              $actions[] = [
                  'strategy'    => ActionReferenceType::EDIT,
                  'permissions' => "{$permissionPrefix}edit",
              ];
          }
  
          if ($addShowAction) {
              $actions[] = [
                  'strategy'    => ActionReferenceType::SHOW,
                  'permissions' => "{$permissionPrefix}show",
              ];
          }
  
          $this->info->list->default_action = $actions;
  
          return $this;
      }
code_tokens: protected function setDefaultRowActions ( ) { $ actions = $ this -> info -> list -> default_action ? : [ ] ; if ( count ( $ actions ) ) { return $ this ; } $ addEditAction = config ( 'cms-models.defaults.default-listing-action-edit' , false ) ; $ addShowAction = config ( 'cms-models.defaults.default-listing-action-show' , false ) ; if ( ! $ addEditAction && ! $ addShowAction ) { return $ this ; } // The edit and/or show action should be set as default index row click action. $ modelSlug = $ this -> getRouteHelper ( ) -> getRouteSlugForModelClass ( get_class ( $ this -> model ) ) ; $ permissionPrefix = $ this -> getRouteHelper ( ) -> getPermissionPrefixForModelSlug ( $ modelSlug ) ; if ( $ addEditAction ) { $ actions [ ] = [ 'strategy' => ActionReferenceType :: EDIT , 'permissions' => "{$permissionPrefix}edit" , ] ; } if ( $ addShowAction ) { $ actions [ ] = [ 'strategy' => ActionReferenceType :: SHOW , 'permissions' => "{$permissionPrefix}show" , ] ; } $ this -> info -> list -> default_action = $ actions ; return $ this ; }
docstring: Sets default actions, if configured to and none are defined.
  
  @return $this
docstring_tokens: Sets default actions if configured to and none are defined .