mysql - Search functionality: loop through all database tables (Laravel) -
i'm looking way loop through database tables in laravel in order add search functionality website.
i guess there should way without hardcoding table names.
you can this:
$tables = db::select("select table_name information_schema.tables table_schema='your_database_name'");
just change your_database_name
own value. can use laravel helper function, array_pluck
, array of table_name
values.
array_pluck($tables, 'table_name')
Comments
Post a Comment