PHP code example of izi-dev / nova-key-value-suggestion-field

1. Go to this page and download the library: Download izi-dev/nova-key-value-suggestion-field 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/ */

    

izi-dev / nova-key-value-suggestion-field example snippets


class Page extends Resource
{

    public function fields(Request $request)
    {
        return [

            \IziDev\KeyValueSuggestion\KeyValueSuggestion::make('Validation')
                ->suggestion([
                    '

class Page extends Resource
{

    public function fields(Request $request)
    {
        return [

            \IziDev\KeyValueSuggestion\KeyValueSuggestion::make('Validation')
                ->suggestion([
                    [
                        "title" => "Accepted",
                        "id" => "accepted",
                        "description" => "The field under validation must be yes, on, 1, or true. This is useful for validating \"Terms of Service\" acceptance."
                    ],
                    [
                        "title" => "Active URL",
                        "id" => "active_url",
                        "description" => "The field under validation must have a valid A or AAAA record according to the dns_get_record PHP function. The hostname of the provided URL is extracted using the parse_url PHP function before being passed to dns_get_record."
                    ],
                    [
                        "title" => "After (Date)",
                        "id" => "after",
                        "description" => "The field under validation must be a value after a given date."
                    ],
                    [
                        "title" => "After Or Equal (Date)",
                        "id" => "after_or_equal",
                        "description" => "The field under validation must be a value after or equal to the given date. For more information, see the after rule."
                    ],
                    [
                        "title" => "Alpha",
                        "id" => "alpha",
                        "description" => "The field under validation must be entirely alphabetic characters."
                    ],
                    [
                        "title" => "Alpha Dash",
                        "id" => "alpha_dash",
                        "description" => "The field under validation may have alpha-numeric characters, as well as dashes and underscores."
                    ],
                    [
                        "title" => "Alpha Numeric",
                        "id" => "alpha_num",
                        "description" => "The field under validation may have alpha-numeric characters, as well as dashes and underscores."
                    ],
                    [
                        "title" => "Array",
                        "id" => "array",
                        "description" => "The field under validation must be a PHP array."
                    ],
                    [
                        "title" => "Bail",
                        "id" => "bail",
                        "description" => "Stop running validation rules after the first validation failure."
                    ],
                    [
                        "title" => "Required",
                        "id" => "