How to Create a Dropdown in Statamic CP that Fetches Data from a Laravel Eloquent Model Using Runway #475
-
DescriptionHello, I’m trying to create a dropdown select field within the Statamic Control Panel that dynamically populates its options from a Laravel Eloquent model. I've followed the Statamic documentation and understand that Runway is the recommended addon for integrating Eloquent models with Statamic. Despite this, I'm facing difficulties in setting up the dropdown to correctly retrieve data from my Eloquent model. I've reached out to Statamic support and was pointed towards using Runway, but I haven’t had success in implementing it. The dropdown I’m aiming for should function similarly to the default 'Author' dropdown that Statamic provides. Has anyone achieved this or could provide guidance on setting up a dropdown select field populated with Eloquent data using Runway? What I've Tried:
I'm a bit stuck and would really appreciate any advice or examples from others who have successfully implemented a similar feature. Thank you for your time and assistance. Environment$ php please support:details Environment Cache Drivers Statamic Statamic Addons |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Have you tried using Runway's Belongs To fieldtype? |
Beta Was this translation helpful? Give feedback.
What does the resource's blueprint look like? Does it have any listable fields?