<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
perryvandermeer / laravel-console-validator example snippets
namespace App\Console\Commands;
use Illuminate\Console\Command;
use PerryvanderMeer\LaravelConsoleValidator\ValidatesArguments;
class ExampleCommand extends Command
{
use ValidatesArguments;
/**
* Set the validation rules that apply to the command.
*
* @var array<string, array|string>
*/
protected array $rules = [
'foo' => ['
namespace App\Console\Commands;
use Illuminate\Console\Command;
use PerryvanderMeer\LaravelConsoleValidator\ValidatesArguments;
class ExampleCommand extends Command
{
use ValidatesArguments;
}
/**
* Set the validation rules that apply to the command.
*
* @var array<string, array|string>
*/
protected array $rules = [
'title' => ['
/**
* Get the validation rules that apply to the command.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
protected function rules() : array
{
return [
'title' => ['
/**
* Set the error messages for the defined validation rules.
*
* @var array<string, string>
*/
protected array $messages = [
'title' => 'Whoo general message for title argument..!',
'content.min' => 'Hmm the content is very short..!',
];
/**
* Get the error messages for the defined validation rules.
*
* @return array<string, string>
*/
protected function messages() : array
{
return [
'title' => 'Whoo general message for title argument..!',
'content.min' => 'Hmm the content is very short..!',
];
}