query('url'); if (!$url || !filter_var($url, FILTER_VALIDATE_URL)) { return response()->json([ 'error' => 'Missing required parameter `url` or invalid URL', ], 400); } $depth = $request->query('depth', 3); $crawlerController = new WebCrawlController(); return $crawlerController->crawlWebsite($request); }); Route::get('/', function () { $crawlerController = new WebCrawlController(); return $crawlerController->index(); }); Route::delete('/crawl/{id}', function ($id) { $crawlerController = new WebCrawlController(); return $crawlerController->destroy($id); }); Route::delete('/crawl', function () { $crawlerController = new WebCrawlController(); return $crawlerController->destroyAll(); });