Questions about "fresh", db relationships, non-db models, caching, and .env #61
Unanswered
quadrastreet
asked this question in
Q&A
Replies: 1 comment 10 replies
-
Note: I found the answer to my 2nd question (model relationships) by reading the Eloquent Model documentation... once I saw the note that Leaf Model extends Eloquent Model. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm brand new to Leaf, so I have a few questions (I'll be using leaf-api):
If I didn't use fresh(), and simply re-ran the first line, would it not re-retrieve from the database?
Relationships -- Is there support for the idea of parent / child records using models? If so, how do I set it up?
Non-DB models -- In my API I'll need to be reading/writing using a database, as well as reading data from a 3rd-party REST API; I know I can put code in my controller to access data via 3rd-party REST API, but I was wondering if you had a strategy to use Leaf models where the data comes from that API rather than a database.
Caching -- Is there support for caching data rather than re-reading from the database with each request? If not, do you have any strategies that might be helpful to me?
.env -- I've read through https://leafphp.netlify.app/#/leaf-api/v/2.0/config/env but still have some questions:
-- APP_ENV -- How is this used?
-- APP_KEY -- How is this used?
-- APP_URL -- How is this used?
Beta Was this translation helpful? Give feedback.
All reactions