Laravel - Eloquent Relationships (Query made; Not fetching value) -


i trying database information, , can see query being done, unable come content... have follows:

class vendor extends eloquent {     public function spider()     {         return $this->hasone('spider');     } }  class spider extends eloquent {  public function report()     {         return $this->hasmany('report');     } } 

so... trying use as:

$vendor = vendor::find(1); $vendor->spider->report->id; 

this not giving me result - id not being fetched. however, can tell correct query being made database...

select * `report` `report`.`spider_id` = ? 

why not giving me anything? have tried several ways such as... $vendor->spider->first()->report->first()->id... , on... errors.

thank's.

report of type hasmany collection retrieved. process collection find instance want.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -