Answers for "laravel select all table names"

SQL
1

get table column names sql laravel

use IlluminateSupportFacadesSchema;

use IlluminateSupportFacadesDB;

public function getTableColumns($table)
{
    return DB::getSchemaBuilder()->getColumnListing($table);

    // OR

    return Schema::getColumnListing($table);

}
Posted by: Guest on December-05-2020
0

get all tables laravel

$tables = DB::select('SHOW TABLES');
foreach($tables as $table)
{
      echo $table->Tables_in_db_name;
}
Posted by: Guest on June-28-2021

Code answers related to "laravel select all table names"

Code answers related to "SQL"

Browse Popular Code Answers by Language