donglu6303 2015-08-13 10:56
浏览 132
已采纳

“NetworkError:在laravel 5.1中找不到404

When I click on a link I have getting the data but my css pages, Js files and images are not working. Below I mention the link, route, controller and error(Firebug console). Please help me to clear this error.

Link from a page

<a href="customersocialpage/<?php echo $searchCustomer->customer_id; ?>"><?php echo ucfirst($searchCustomer->firstname); ?></span> <?php echo ucfirst($searchCustomer->lastname); ?></h5></a>

routes.php

$router->get('customersocialpage/{id}', ['as' => 'custsocialpage', 'uses' => 'CustomersocialpageController@index']);

CustomersocialpageController.php

public function index($id)
    {
        dd($id);
        $customersocialpages = Customeraddress::where('customer_id', $id)->first();
        return view('pages.customersocialpage',['customersocialpages' => $customersocialpages]);
    }

Error

"NetworkError: 404 Not Found - http://baselaravel.dev/customersocialpage/assets/img/demo/calendar_app.svg"

Link to CSS

{!!HTML::style('assets/plugins/pace/pace-theme-flash.css')!!}
{!!HTML::style('assets/plugins/boostrapv3/css/bootstrap.min.css')!!}
{!!HTML::style('assets/plugins/font-awesome/css/font-awesome.css')!!}

Link to JS

{!!HTML::script('assets/plugins/imagesloaded/imagesloaded.pkgd.min.js')!!}
{!!HTML::script('assets/plugins/jquery-isotope/isotope.pkgd.min.js')!!}
{!!HTML::script('assets/plugins/classie/classie.js')!!}
{!!HTML::script('assets/plugins/codrops-stepsform/js/stepsForm.js')!!}

All the css, images and js are in public folder

  • 写回答

2条回答 默认 最新

  • douyong6589 2015-08-13 12:17
    关注

    Ok as conversation with the OP ,there were some mistakes in including assets file . So they should be included in following ways :

    <link type="text/css" href="{{URL::to('assets/plugins/pace/pace-theme-flash.css')}}"></link>
    <link type="text/css" href="/assets/plugins/pace/pace-theme-flash.css"></link> \
    

    Images

     <img alt="Cover photo" src="{{URL::to('assets/img/social/cover.png')}}" />
    
     <img alt="Cover photo" src="/assets/img/social/cover.png" />
    

    There are many ways of including files , just depend on you which you follow . check this link for including assets also . Rest laravel docs are always there. :)

    Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里