I am trying to write a global fn for my cat system that is in the base controller. here is the fn inside the base cont
public function rec_cat($table,$col,$col_id,$rec_arr=array()) { $ups=DB::table($table)->where($col,$col_id)->get(); foreach ($ups as $up) { $rec_arr[]=$up; $this->rec_cat($table,$col,$col_id,$rec_arr); } return $rec_arr; }
when I try to call this fn in my controller $select=$this->rec_cat('kategori','up_id','0'); return var_dump($select); I get this error Allowed memory size of 134217728 bytes exhausted (tried to allocate 196605 bytes)
The bytes written in the error is smaller than the allowed memory size so I think I have another problem.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community