Answer the question
In order to leave comments, you need to log in
How to pass data to the model?
Hello.
I'm building a laravel site with very simple functionality: entity output, filtering, pagination, navigation, etc.
The catch is that I do not take the data from the database, but from the api.
Question: is it possible to transfer data from api to a model so as not to change the laravel structure with models and controllers?
Answer the question
In order to leave comments, you need to log in
You can transfer:
$data = $api->getJson();
$model = new YourModel($data);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question