make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); if (! \App\Modules\Identity\Services\LocalDatabaseGuard::allows()) { throw new RuntimeException('Own local development database required.'); } $db = \Illuminate\Support\Facades\DB::class; $counts = []; foreach (['users','companies','units','a_clients','a_services','a_service_drafts','a_billing_drafts','b_internal_confirmations','doc_records','doc_history'] as $table) { $counts[$table] = $db::table($table)->count(); } $grants = $db::table('permission_grants')->whereIn('permission', ['issuer_documents.view','issuer_documents.edit','client_documents.view','client_documents.edit','draft_documents.view','draft_documents.edit'])->orderBy('user_id')->orderBy('permission')->get(['user_id','company_id','unit_id','permission']); echo json_encode(['database' => 'sgf_tempo_dev', 'counts' => $counts, 'document_grants' => $grants], JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE).PHP_EOL;