diff --git a/app/Http/Controllers/Admin/AdminInstanceController.php b/app/Http/Controllers/Admin/AdminInstanceController.php new file mode 100644 index 00000000..55600fdf --- /dev/null +++ b/app/Http/Controllers/Admin/AdminInstanceController.php @@ -0,0 +1,35 @@ +paginate(5); + return view('admin.instances.home', compact('instances')); + } + + public function instanceScan(Request $request) + { + DB::transaction(function() { + Profile::whereNotNull('domain') + ->groupBy('domain') + ->chunk(50, function($domains) { + foreach($domains as $domain) { + Instance::firstOrCreate([ + 'domain' => $domain->domain + ]); + } + }); + }); + return redirect()->back(); + } + +} \ No newline at end of file