A few simple operations based on the laravel5.4 version of the query constructor: (relative to the TP3.2 version)
//gets the specified multiline multi-column, two-dimensional, object "select"$names ="'; $names= Db::table ('Student')->whereraw ('ID >? and age <?',[1, -])Select('ID','name',' Age'),Get(); Var_dump ($names); Echo"<br>"; //gets the specified single-line, one-dimensional, object "find"$names ="'; $names= Db::table ('Student')->whereraw ('ID >? and age <?',[1, -])Select('ID','name',' Age'),First (); Var_dump ($names); Echo"Ceshi"; Echo"<br>"; //gets the specified column value, returning the string "GetField"$names = Db::table ('Student')->whereraw ('ID >=? <?',[1, -])->value ('name'); Var_dump ($names); //string (3) "Bob"Echo"<br>"; //gets the specified name column, returning the one-dimensional array "Getfield,true"$names ="'; $names= Db::table ('Student')->whereraw ('ID >=? <?',[1, -])->pluck ('name'); Var_dump ($names); Echo"<br>"; Var_dump (Json_encode ($names,true));//array "[" Alice "]"
Add the hard and the others later.
laravel5.4 db::table Action