【问题标题】:Laravel project routing is producing errorsLaravel 项目路由产生错误
【发布时间】:2021-07-09 04:34:48
【问题描述】:

我正在创建一个要托管在服务器上的应用程序,并且我使用了 .htaccess 但是加载的第一页通常是登录屏幕(其路径在我的资源文件夹中)已更改为公用文件夹,我单击其他任何地方,因为所有内容都链接到公用文件夹,这不正确,因为它应该在资源文件夹中......应用程序工作正常,它只是给我一个问题的路由,所以当我点击它说的其他任何地方时, '在服务器上找不到请求的url'

我也尝试将视图文件夹放入公用文件夹并在那里路由

我的主页设置为:

Route::get('/', function () {
    return view('auth/login');
});

但是当移动到公用文件夹时出现错误,错误读取,

InvalidArgumentException
View [auth.login] not found.

【问题讨论】:

  • View [auth.login] not found. 请阅读本文
  • 是的@KamleshPaul,但是我该如何路由呢?
  • /view/auth/login.blade.php 文件未找到它正在显示
  • 你有 laravel-8 吗?

标签: php mysql laravel laravel-8


【解决方案1】:

清除缓存并重新启动服务器:

composer dump-autoload;
//---Flush the application cache
php artisan cache:clear;
//---Remove the configuration cache file
php artisan config:cache;
php artisan config:clear;
//---Remove Routes Cache
php artisan route:clear;

【讨论】:

  • 转到 bootstrap/cache 并将 config.php 重命名为 config.php_
  • 我在 bootstrap 中没有 config.php...只有服务和包
  • 你的项目中有 laravel/bootstrap/cache 文件夹吗?
  • 我刚刚在 app 文件夹下有一个 bootstrap 文件夹,而 laravel 文件夹有一个 bootstrap 但没有缓存
  • 运行 php artisan make:auth 怎么样?
猜你喜欢
  • 2017-08-05
  • 1970-01-01
  • 2013-12-28
  • 1970-01-01
  • 2015-09-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多