I'm trying configure a relationship with same model/table, but Laravel return a error: timeout.
Table: collections
- id
- collection_id
- name
- description
- active
- timestamps...
Model/Relationship: Collection
/* ----------------------------------------------------------------------------
| Relationships
| -----------------------------------------------------------------------------
|
| Relacionamentos
|
*/
/**
* collection method
* Coleção pode pertencer a outra coleção
*
* @access public
* @return void
* @since 1.0
* @version 1.0
* @author Patrick Maciel
*/
public function collection()
{
return $this->belongsTo('Collection');
}
/**
* collections method
* Coleção pode ter várias sub-coleções
*
* @access public
* @return void
* @since 1.0
* @version 1.0
* @author Patrick Maciel
*/
public function collections()
{
return $this->hasMany('Collection');
}
Error
How can I solve that for get collection (parent), and collections (childrens)? Thanks