خرید بک لینک

Vote count: 0

Ok so been trying to figure out how to setup this relationship. Using eloquent Lumen. I have two tables. A Listing table. which contains Consoles. I dont want an emum or plain text in their so I want to extract that into a console table. Console 1, console 2 etc. but i caot get the relationship to match up for some reason.

Listing Table:
id: 1 | console_id: 3
id: 2 | console_id: 4
id: 3 | console_id: 3
id: 4 | console_id: 2

Console Table:
id: 1 | console: Console 1
id: 2 | console: Console 2
id: 3 | console: Console 3

Now In my Listing model i have:

public function console()
{
    retu $this->belongsTo('AppConsole');
} 

The relationship is broken or I am not understanding how this relationship should be tied together...

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 20 ارديبهشت 1395 ساعت: 8:01

صفحه بندی