Open browner12 opened 1 month ago
I can try to make this working.
return view(match ($skin) {
'baja-blast' => 'customs.baja-blast',
'code-red' => 'customs.code-red',
'non-static' => 'customs.wont-work-' . rand(1, 10), //this one would not work
default => 'default.path',
});
Feature Description
Sometimes I'll have a component that supports different "skins", which just means that we conditionally load a view. By passing a variable to the
view($pathToFile)
method we lose the ability to click through to the view.It would be amazing if the plugin could analyze the variable, and provide a drop down of any static options (like it does for other features) to allow us to select. I realize it would be impossible to handle any non-static values, and those could be ignored.