简体   繁体   中英

Laravel 5.4 css files not showing and showing NotFoundHttpException

i have installed Laravel 5.4 in localhost. I'm using XAMPP to host the application. I'm using Laravel's inbuilt Blade template structure to show the data. I have used asset() helper to load my assets files which is inside the public folder. A sample code is here.

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

But CSS file is not loading. I discovered this from Chrome developer tool's Network section. I have worked with Laravel before with it's other version and this is the first time that i'm working with version 5.4. Hope someone will assist me to solve this.

you can use only asset function like this i hope you have css folder inside public folder as mentioned in the path.

<link href="{{asset('backend/vendors/bootstrap/dist/css/bootstrap.min.css')}}" rel="stylesheet" type="text/css">

asset()

Generate a URL for an asset using the current scheme of the request (HTTP or HTTPS):

Ref: https://laravel.com/docs/5.4/helpers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM