argument('user')); $json_file_path = $this->argument('json_file'); if (!file_exists($json_file_path)) { throw new RuntimeException('Unable to find JSON file'); } $json = file_get_contents($json_file_path); $bookmarks = json_decode($json, true); foreach (array_chunk($bookmarks, self::$perBatch) as $bookmarks_json) { ImportBookmark::dispatch($user, ...$bookmarks_json); } } }