Support the ongoing development of Laravel.io →
posted 9 years ago
Validation
Last updated 2 years ago.
0

This is solved.

I realised that "username" is a custom column name. I also had to change from using arrays to lay out the validation rules, to using strings. {{$id}} is replaced by the actual id.

public static $rules = [
        'email' => 'required|max:100|unique:users,email,{{$id}}',
        'username' => 'required|max:32|unique:users,username,{{$id}}',
        'password'              => 'required|alpha_num|between:4,8|confirmed',
        'password_confirmation' => 'required', 'between:4,8'
    ];
0

Sign in to participate in this thread!

Eventy

Your banner here too?

fugazied fugazied Joined 30 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.