To meet a requirement, you need to modify all the tables in the database that contain the email fields, and change the length of the inside to 128 bits. Laravel gets all the tables and then loops through the table to see if there is any email in this field. The code is as follows:
Use Illuminate\support\facades\schema;
Use DB;
Public Function Getdatabasecolumns () {
$tables = Db::select (' Show Tables ');
$tables = Array_column ($tables, ' tables_in_new_bcc_web ');
$columns = [' email ', ' user_name ', ' nick_name ', ' first_name ', ' last_name '];
DD (Schema::getconnection ());
foreach ($tables as $key = + $value) {
foreach ($columns as $k + $v) {
if (Schema::hascolumn ($value, $v)) { c9/> $table [] = $value;
};
}
$columns [] = schema::getcolumnlisting (' users ');
}
$table = Array_unique ($table);
DD ($table);
}
Schema::getcolumnlisting (' user ');
Schema::hascolumn ($table, $column _name)
Here to remember, than to know there is no better way to get to the current connected database inside all the tables, I was using native SQL statements show tables to isolate all tables, and then remove tables_in_new_bcc_web This column before you get all the table names, and then go back to the loop.
Find a great way to:
Public Function Getdatabasecolumns () {
$tables = array_map (' Reset ', \db::select (' SHOW tables '));
$columns = [' email ', ' user_name ', ' nick_name ', ' first_name ', ' last_name '];
foreach ($tables as $key = + $value) {
foreach ($columns as $k + $v) {
if (Schema::hascolumn ($value, $v)) { c7/> $table [] = $value;
};
}
}
$table = Array_unique ($table);
DD ($table);
}