使用刀片访问laravel中的公用文件夹

Reh*_*han 1 css laravel-5 laravel-blade

我有一个视图叫homePage.blade.php哪个是我的主页,它位于res/views/该文件中我有这个.

<link rel="stylesheet" href="css/coreStyleSheet.css">
<link rel="stylesheet" href="css/animate.css">
<script src="js/coreScripting.js"></script>
<script src="js/moments.js"></script>
<link rel="stylesheet" href="icons/fontAwesome/css/font-awesome.css"> </head>
Run Code Online (Sandbox Code Playgroud)

一切都很好?

现在我创建了一个名为AppCreatewho的路径的文件夹,res/views/AppCreate我现在有一个刀片文件,something.blade.php当我使用时,我@extends('homePage')无法访问css,js.

我的树看起来像这样.

-res -views homePage.blade.php -AppCreate -something.blade.php

我重定向something.blade.php tp public/admin/appcreate我将homePage.blade.php重定向到public/dashBoard.

我希望我已经解释得很好.

当我访问public/admin/appcreate时laravel无法找到css和js,因为它说明了这一点.

    GET http://localhost/laravel/public/admin/css/coreStyleSheet.css 
appcreate:12 GET http://localhost/laravel/public/admin/js/moments.js 
appcreate:11 GET http://localhost/laravel/public/admin/js/coreScripting.js 
appcreate:13 GET http://localhost/laravel/public/admin/icons/fontAwesome/css/font-awesome.css 
Run Code Online (Sandbox Code Playgroud)

Sod*_*odj 7

尝试使用这样的帮助函数:

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

<script src="{{ asset('js/coreScripting.js') }}"></script>

假设你在公共/资产中有你的cssjs文件夹