【问题标题】:Failed to load resource: the server responded with a status of 404 (Not Found) Laravel加载资源失败:服务器响应状态为 404 (Not Found) Laravel
【发布时间】:2017-04-26 06:22:08
【问题描述】:

由于某种原因,我的 edit.blade.php 无法加载 css/js 文件。我从我的 create.blade.php 复制了能够加载所有这些 css/js 文件的代码。发生这种情况是否有与编辑有关的原因?

 public function edit($id)
    {
        return view('Post.edit');
    }

【问题讨论】:

  • CSS/JS 不加载意味着你可能没有扩展你的默认布局..你能显示你的 create.blade.php 文件和 create()..

标签: laravel


【解决方案1】:

请检查:

  • CSS 文件应该(如果你不使用 gulp 等)在 public/css 文件夹中
  • 您需要使用资产加载 css(资产为您提供公用文件夹的路径)

<link rel="stylesheet" href="{{ asset('css/style.css') }}">

【讨论】:

    猜你喜欢
    • 2018-06-08
    • 2021-12-13
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多