PHP code example of rylacdang / formcast

1. Go to this page and download the library: Download rylacdang/formcast 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/ */

    

rylacdang / formcast example snippets


class StoreOrderRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'customer_email'     => ['d_if:payment_method,gcash', 'string', 'size:13'],
            'items'              => ['0'],
        ];
    }

    public function attributes(): array
    {
        return ['gcash_reference' => 'GCash reference number'];
    }
}
bash
php artisan formcast:generate