Getting value from array [SOLVED]

hi guys, I had an issue with getting value from array that I’ve set it at my gender.php

and here’s the code

namespace App\Helpers\Enums;

final class Gender {
const MALE = 0;
const FEMALE = 1;
public static function getList() {
	return [
		Gender::MALE,
		Gender::FEMALE,
	];
}

public static function getArray() {
	$result = [];
	foreach (self::getList() as $arr) {
		$result[$arr] = self::getString($arr);
	}
	return $result;
}

public static function getString($val) {
	switch ($val) {
		case 0:
			return "Male";
		case 1:
			return "Female";
	}
}

}

and here’s my create.blade code

{!! Form::select('gender', array('Male', 'Female'), null, array('class' => 'form-control')) !!}

And what was the issue that you had, specifically?

Hi droopsnoot, thanks for the attention. this one already solved.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.