Datatable is not displaying data when I use $request->query('');

Datatable is not displaying data when I use $request->query('');

papirri3papirri3 Posts: 1Questions: 1Answers: 0
edited July 2021 in DataTables
$query = 6; <------------------- this works fine and the list is filtered and displayed.
$query = $request->query('c'); <----------------------- but when I use this, nothing is displayed.

  $list = S1dg::select(['da_id', 'esc_nombre', 'cct', 'cve_mpio', 'nombre_director', 'p_apellido_director', 's_apellido_director', 'id_estatus_acta', 'telefono'])
                ->where('cve_sede', '=', $query)
                ->get();

           
                if($request->ajax()){
                    return datatables()->of($list_escuelash)
                        ->addIndexColumn()
                        ->make(true);
                }

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    You are doing to need to give me a bit more context here. I don't know what $request is here, or what it's query method is. Does the library you are using allow a ->query() result to be passed in as the third parameter to ->where()?

    I suspect you are going to need to ask the author of whatever library it is that you are using here - it doesn't look like one we publish.

    Allan

Sign In or Register to comment.