file('file'); if(!$file->isValid()){ throw new \Exception('Invalid file'); } $content = file_get_contents($file->path()); if(empty($content)) { throw new \Exception('Empty File'); } //TODO: Evaluate to deatch this execution from the web request $credentials = (new StealerParser($content))->parse(); return response()->json([ 'status' => 'success', 'data' => $credentials ]); } }