dtz88967 2016-10-09 21:49
浏览 47

将Laravel 5.2应用程序推送到Heroku,公共/所有文件都丢失了

I have a Laravel application deployed on Heroku. However, all files that are in 'public' folder of my application are not loaded.

That is, no css and / or js are loaded pages after deployment. Only HTML is loaded.

This is the structure of my 'public' folder:

This is the structure of my 'public' folder

I'm loading the css that way:

<link href="{{ URL::asset('css/bootstrap.min.css') }}" rel="stylesheet">

And JS that way:

{!! Html::script('js/parsley.min.js') !!}

EDIT

I've figured out what was wrong.

Instead of loading the css the way I was doing, I should do this:

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

And for Js:

<script type="text/javascript" src="{{ asset('js/parsley.min.js') }}></script>
  • 写回答

1条回答 默认 最新

  • dtyz76562 2016-10-09 22:46
    关注

    It's very strange.

    Are you sure that the files exist in the public folder?

    Laravel 5.2 does not include html helpers function out the box, do you update your composer?

    You can remove helper function and try without it, just use...

    for css

     <link href="/css/bootstrap.min.css" rel="stylesheet">
    

    and js

       <script src="/js/parsley.min.js"></script>
    

    if everything is ok, the problem is in your helper functions.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型