public function buildLists()
{
$tables = $this->db->table($this->app['config']['jables.table'])->orderBy('id', 'desc')->where('type', '=', 'table')->get();
foreach ($tables as $raw) {
$defs = json_decode($raw->data);
foreach ($defs as $table => &$x) {
$this->tables[] = $table;
}
}
$foreigns = $this->db->table($this->app['config']['jables.table'])->orderBy('id', 'desc')->where('type', '=', 'foreign')->get();
foreach ($foreigns as $raw) {
$tabs = json_decode($raw->data, true);
$this->foreigns = array_merge_recursive($this->foreigns, $tabs);
}
return true;
}