Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RichardWilliamssonik's avatar

How to generate dynamic Laravel Nova select field?

I'm trying to create a dynamic Laravel Nova select field but am having some issues.

I have an array in my config file that I am trying to use to generate these values. Here is my code:

Select::make('Options')->options(function () { $options = config('options.options'); $optionsArray = []; foreach($options as $index => $option) { $optionsArray[$index] = $option; } return [ $optionsArray ]; }), But, this does not https://voojio.com/chatroom/omegle seem to work. The $optionsArray is populated with all of the values that I want, but the select field has no options in Nova on the front end. How can I make https://omegle.club this work?

0 likes
1 reply
vincent15000's avatar

I don't know Nova, but this should work.

Select::make('Options')->options(function () {
	$options = config('options.options');
	$optionsArray = [];
	foreach ($options as $index => $option) {
		$optionsArray[$index] = $option;
	}
	return $optionsArray;
});

Please or to participate in this conversation.