Description

This extension is used to generate comments that suggest the location of the validator

If you use the validate middleware, then all validation will be done in the middleware part and the data will already be processed when it is passed to the controller.

This extension will generate the following annotation based on the configuration in ValidateMiddlewareConfig to easily locate the validator

/**
 * @validate {@see UserValidate::sceneLogin()}
 */

Install

composer require itwmw/engine-validate-ide-helper --dev

Using

Other frameworks can integrate the Itwmw\Validate\Ide\Helper\IdeHelperCommand command on their own

Rangine

If you are using the Rangine framework, after installing this extension, you can directly use the command

bin/gerent make:validate-ide [Full namespace or full file name] --dir [File Directory]

Laravel

If you are using the Laravel framework, after installing this extension, you can directly use the command

php artisan make:validate-ide [Full namespace or full file name] --dir [File Directory]

WebStorm Integration

Rangine

File->Settings->Tools->External Tools->Add

  • Name:Validate-Ide Or feel free to
  • Program:bin\gerent Select bat file for Windows systems
  • Arguments:make:validate-ide $FilePath$
  • Working directory:$ProjectFileDir$

Laravel

File->Settings->Tools->External Tools->Add

  • Name:Validate-Ide Or feel free to
  • Program:If you have PHP environment variables, you can write php directly, otherwise choose the location of php.exe.
  • Arguments:artisan make:validate-ide $FilePath$
  • Working directory:$ProjectFileDir$

Shortcuts

To make it easier to use, you can set a shortcut key for this tool

File->Settings->Keymap->External Tools->Validate-Ide-Helper->Right click->Add keyboard Shortcut,The author here isALT+G