table; $data['db_key'] = $this->primaryKey; $data['route'] = $route; $dtable = \DB::select("SELECT * from reff_brand order by id_brand desc"); // LIST DATA TABLE $data['data_table'] = $dtable; // FORM FIELD FOR STORE $data['set_field'] = [ 'name_brand' => $cGlobal->cleanString($request->post('name_brand')) ]; // GET DATA FOR EDIT if ($request->post('id')) { $data['get_data_edit'] = collect(\DB::select("SELECT * FROM reff_brand where id_brand = ?",[$request->post('id')]))->first(); } foreach($data['tableHead'] as $v){ $arrHead[] = $v[2]; } $data['head'] = implode(",",$arrHead); return $data; } public function getDT($data,$init) { $dt = DT::of($data); return $dt; } }