Created
February 27, 2020 14:59
-
-
Save fridzema/0bb76179a155024b6939613dd028499e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tables = collect(Schema::getAllTables())->pluck('Tables_in_pmp'); | |
$softdeletes = []; | |
foreach ($tables as $table) { | |
if (Schema::hasColumn($table, 'deleted_at')) { | |
$softdeletes[$table] = DB::table($table)->whereNotNull('deleted_at')->count(); | |
} | |
} | |
$softdeletes = collect($softdeletes)->filter(function ($value, $key) { | |
return $value > 0; | |
}); | |
dd($softdeletes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment