Joined February 2012
·
Posted to
Validate Multiple Choice fields in Laravel 4
over 1 year
ago
I'm having a similar situation. I have a text input where the user can enter different tags and when submitting, laravel returns me this string:
Input::get('tags') = 'tag1,tag2,tag3'.
To separate each one
$alltags = explode(',', Input::get('tags'));
Now:
$alltags = ['tag1','tag2',tag3']
To validate the tags:
for ($i = 0; $i < count($alltags); $i++)
$rules[$i] = 'required|between:3,15';
$v = Validator::make($alltags, $rules);
Is there any other way to validate them?
When i return the errors it displays:
"The 2 must be between 3 and 15 characters."
Where 2 is the 3rd tag on the array. Instead it could show like yours
tag.2
Posted to
Nice way to hash password in laravel when creating new user
over 1 year
ago
I do it this way:
$data = Input::all();
$user->password = Hash::make($data['password']);
I don't know, i find it simpler that way
Posted to
Pure CSS Game - No JS!
over 1 year
ago
I killed just 1 bird. D:
Achievements
90 Karma
338 Total ProTip Views

Forked
Have a project valued enough to be forked by someone else

Lab
Have at least one original repo where C# is the dominant language

Bear
Have at least one original repo where Objective-C is the dominant language

Nephila Komaci
Have at least one original repos where PHP is the dominant language

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Python
Would you expect anything less? Have at least one original repo where Python is the dominant language

T-Rex
Have at least one original repo where C is the dominant language

Komodo Dragon
Have at least one original repo where Java is the dominant language

Epidexipteryx
Have at least one original repo where C++ is the dominant language
Thank you.