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
Post a Comment