php - How to access db views using Laravel models? -
Get link
Facebook
X
Pinterest
Email
Other Apps
Made in DB These ideas make different consolidation and average tasks in advance, and as if they are correctly part of the schema, because they explain the relations between table entities.
Surely anyone has active record style interface of DB scenes Laravel? How are you aware all this stuff?
Your query is about the database and if I'm not mistaken, you talk about the dynamic table It is possible to create view by using something like this, for example, in MySQL :
< Code> See students as students' selection * Type = 'student' order from id where from profiles;
Therefore, this dynamic table will allow you to select students here, for example:
From students;
This will return the filtered data from the students , so if I am right about your question, then I think that you supernatural Are able to use such as you use for real tables, for example, to make eloquent models, students can make it view easily Are:
view class student eloquence {protected $ table = 'students'; }
Therefore, you can now easily use this model as you can for other tables; for example;
$ students = viewstudent :: all);
This is the same method as you have asked for psql , so I am not sure about that syntax or how it works in that system , But I believe it is possible in the same way.
Comments
Post a Comment