Laravel @extends('layouts.app') not working on some pages

房东的猫 提交于 2019-12-11 15:38:11

问题


@extends('layouts.app') does not work on some of my web pages. it just shows the content without the layout. why is this happening?

I already tried making a new layout folder and calling it but still some pages still doesn't show the layout.

both show.blade.php and create.blade.php doesn't display the layout

it only shows like this

app.blade.php this is the navbar.blade.php


回答1:


Your CSS file maybe not loading properly.

change your app.blade.php file like below,

<link rel="stylesheet" href= "/css/app.css" >



回答2:


you might what to try this:

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



回答3:


In my case this fixed it (had to add public):

href="{{ asset('public/css/app.css')



来源:https://stackoverflow.com/questions/54283283/laravel-extendslayouts-app-not-working-on-some-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!