I have this same question too. Please were you able to resolve it? @simber
Nova resource from API data
Is there a way to create a Nova resource that doesn't fetch from DB but instead from a remote API?
Yes, it possible to do this. I am in the midst of doing this now.
in short, my approach was:
1.) Code Services to interact with my API 2.) Code Custom Rules and use model Get Attributes 3.) Use Event Listeners that will call my API service and run the required tasks 4.) Do whatever/Override any data required locally 5.) Local Data will update/save/etc.
In my current instance, I have setup a micro-service to handle all aspects of my users and their profiles. The service will handle everything from validation of user profile data to authenticating a session, all through API. When I create a user, Instead of saving to the DB, I save to the API and then simply store the UID locally. I have leveraged, setting attributes, custom validation rules, to call API endpoints and customizing the resources functions to all fit my need. As of this post everything is working fantastically and only thing left is to work in being able to use the Searching functions for Nova to be able to find the resources as if thee data was local.
This is my first time every playing with Nova, in fact I only just bought the license last night. Being able to accomplish this is really really exciting and looking forward to being able to mast nova like I have with Laravel.
Feel free to contact me if you have any other questions.
Please or to participate in this conversation.