Deep down in my components tree I have a select tag, which need to be populated by data from the backend. This should happen initially when the page loads.
Is there a way to pass data using with in my controller and then into some auxillary js file?
return view('greeting')->with('name', 'Victoria');
An option is doing an API call after component mount but I rather avoid that. What is the best practice here?
index.blade.php, then in a script or on an element do:let myData = '{{ $name }}'or<input type="hidden" name="name" value="{{ $name }}" />