Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

I don't understand your question. Please more detail

Last updated 2 years ago.
0
Solution

Okay so I'm writing a webapp that uses polymer and angular on the front-end and laravel 5 on the back-end. The back-end functions mostly as a REST service.

So for example right now I'm writing an ajax-table element with polymer that retrieves its data from laravel using ajax calls. However, to make sure it displays all the information correctly it would be handy for it to understand the schema of the table its representing. For example, it would be very useful to know that the column called user_id is actually a foreign-key that links to another table. Etcetera. Therefore I was wondering if I could somehow extract that schema information using eloquent and then send that to the front-end when it asks for it.

But now that I've thought about it, that probably wouldn't work anyway, because not all that information could be stored in the normal table schema. For example, what if a column represents a link to an image? That's not defined in the table schema, so I'd have to add that information manually. And then I might as well do the whole thing manually. So I will.

I guess this hasn't made it much more clear to you, but for me it solved the problem. :-)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Evertt evertt Joined 20 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.