PHP code example of brokeyourbike / enum-validation

1. Go to this page and download the library: Download brokeyourbike/enum-validation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brokeyourbike / enum-validation example snippets


use Illuminate\Foundation\Http\FormRequest;
use BrokeYourBike\EnumValidation\IsValidEnum;

enum DrinkEnum: string {
    case WINE = 'wine';
    case VODKA = 'vodka';
}

class ExampleRequest extends FormRequest
{
    public function rules()
    {
        return [
            'drink' => [
                '