我已经开始在现有的laravel项目中工作,与往常一样,我发现所有路由都放置在route / web.php中。但是,当我声明一条新路线时,即使在工匠def nextMove(snake_head, x_ch, y_ch):
x1_change, y1_change = x_ch, y_ch
x1, y1 = snake_head
next_x, next_y = x1 + x1_change, y1 + y1_change
if next_x < 0 or next_x >= dis_width:
x1_change = 0
y1_change = 10 if y1 < dis_height // 2 else -10
if next_y < 0 or next_y >= dis_height:
x1_change = 10 if x1 < dis_width // 2 else -10
y1_change = 0
return x1_change, y1_change
命令中也找不到该路线。
所以到目前为止,我一直在尝试找出现有路由的工作方式,因为我只是从现有route / web.php文件中删除了一些路由,但是我只是想知道发现它对项目没有影响。所有已删除的路由仍将重定向到控制器的指定方法,并且所有功能均正常运行。因此,似乎还有另一个文件代替默认的web.php
我已经清除了所有缓存
route:list
web.php上的所有路由如下
php artisan config:cache
php artisan cache:clear
php artisan view:clear
那么有什么方法可以找出在后台运行的路由文件吗?
还是真的有可能更改路由文件的默认路径,然后更改route / web.php?
答案 0 :(得分:0)
您清除了许多缓存,但没有清除路由缓存。
尝试运行php artisan route:cache
清除路由缓存。
在运行composer.json
之后,您的路由会被缓存,这有时会包含在library(geosphere)
inds <- which.min(sapply(all, nrow))
ref <- all[[inds]]
remaining <- all[-inds]
output <- lapply(remaining, function(x) {
x[apply(ref[-1], 1, function(y) {
which.min(distm(y, as.matrix(x[-1]), fun = distGeo))
}),]
})
脚本中,因此即使您不知道,它也会发生。
答案 1 :(得分:0)
有一个文件可用于所有路线设置app/Providers/RouteServiceProvider.php
。它具有方法map(),在该方法中绑定两个路由文件– Web和API:
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}