I have been trying to access it like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
</head>
<body>
<div class="red">
@yield('content')
</div>
</body>
</html>
I put the background red in the css file but nothing is changing. Any help is appreciated
put it in public/css and use it like this:
<link rel="stylesheet" href="{{ asset('/css/app.css') }}">
You need to install laravel mix. As it is added in the package.json in fresh installation of laravel, follow below steps:
npm install
to install package that are added in package.json moremix.css('resource/css/app.css', 'css');
to the webpack.mix.js file morenpm run dev
to compile files that are addressed in webpack.mix.js more{{ asset('css/app.css') }}
in the desired blade file.Notice: You need to run npm run dev
after any changes that you make in the resource/css/app.css file. Or benefit from npm run watch
which complies automatically after any changes.
Notice: Press ctrl+f5
to clear cache after every change or use cache busting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With