orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
138 stars 34 forks source link

Seting custom attributes for validator errors failed #35

Closed realmrv closed 3 years ago

realmrv commented 3 years ago

Setting Custom Validation Attributes in validation.php selected locale "ru" does not work for crud create form. Setting Custom Validation Attributes in "attributes" method crud resource also doesn't work.

image

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Attributes
    |--------------------------------------------------------------------------
    |
    | The following language lines are used to swap our attribute placeholder
    | with something more reader friendly such as "E-Mail Address" instead
    | of "email". This simply helps us make our message more expressive.
    |
    */

    'attributes' => [
        'title' => 'Название',
        'landing_page_link' => 'Ссылка на посадочную страницу',
        'recipient_list_file' => 'Файл определенного формата',
    ],
    /**
     * Get custom attributes for validator errors.
     *
     * @return array
     */
    public function attributes(): array
    {
        return [
            'title' => 'Название',
            'landing_page_link' => 'Ссылка на посадочную страницу',
            'recipient_list_file' => 'Файл определенного формата',
        ];
    }
jlevers commented 3 years ago

I'm running into this issue as well, on v3.0.0.