php - Trying to get all column names in a table -


i found this answer says this:

$columns = schema::getcolumnlisting('users'); 

but doesnt use, suppose should be:

use illuminate\database\schema\builder schema; 

but when try it doesnt work:

$columns = schema::getcolumnlisting("users"); 

i error:

non-static method illuminate\database\schema\builder::getcolumnlisting() should not called statically, assuming $this incompatible context

you can do:

$columns = db::getschemabuilder()->getcolumnlisting('users'); 

and use db; import needed dependencies.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -