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

@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

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Your CSS file maybe not loading properly.

change your app.blade.php file like below,

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

Method 2

you might what to try this:

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

Method 3

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

href=”{{ asset(‘public/css/app.css’)

Method 4

If your style css not working on every page, try adding it with the asset helper;

This help me to solve exactly the same problem. You can find in Laravel Docs. ;
https://laravel.com/docs/8.x/helpers#method-asset


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x