In layouts.app.blade.php to the <head> add
@stack('css')
Then where you need add an other css
@push('css')
<link rel="stylesheet" href="path to your css">
@endpush
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
using Laravel 7 and I have following welcome.blade.php file
@extends('layouts.app')
@section('content')
@include('pages.main')
@include('partials._footer')
@endsection
my main.blade.php file is like
<main role="main">
<div class="album py-5 bg-light">
<div class="container ">
<div class="row">
<div class="col-md-4">
<a href="#" class="thumbnail">
<div class="card border-dark mb-3 rounded-0" style="max-width: 25rem;">
<div class="card-header bg-transparent border-dark rounded-0">Header</div>
</div>
</div>
</div>
and I need add some css file name album.css to main.blade.php file in side the pages folder and css file is in the public/css folder. then how could I add my css file to main blade file as external file?
In layouts.app.blade.php to the <head> add
@stack('css')
Then where you need add an other css
@push('css')
<link rel="stylesheet" href="path to your css">
@endpush
Please or to participate in this conversation.