Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Loop over all tables in a database.
use Illuminate\Database\Capsule\Manager as DB;
'host' => 'localhost',
'database' => 'information_schema',
'username' => 'usr',
'password' => 'pwd',
'collation' => 'utf8_general_ci',
'charset' => 'utf8',
'driver' => 'mysql',
'prefix' => ''
), 'information_schema');
$table_names =
->where('TABLE_SCHEMA', '=', 'pmdev_responsive')
->where('TABLE_NAME', 'LIKE', 'ctx_%')
foreach ($table_names as $table_name) {
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.