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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -