Joined February 2012
·

Jun Singht

NA
·
·
·

Thank you.

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

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
313 Total ProTip Views