Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 where to place and how to access image inside css

Tags:

css

laravel-5

In Laravel 5, in what directory should I store images (for backgrounds) and how to access it inside a CSS file. My CSS file is on public/css directory. I've tried to place the image in public/images and public/assets/images but didn't work and even I couldn't access the image directly from web browser.

like image 639
OrgGila Avatar asked Apr 06 '16 14:04

OrgGila


People also ask

Where to put img in Laravel?

Just put your Images in Public Directory (public/... folder or direct images). Public directory is by default rendered by laravel application.


1 Answers

In CSS you can access images, when they are in public/images, like

../images/imgename.jpg

In the blade template, you can use something like

"{{ asset('images/imagename.jpg') }}"

like image 63
Qammar Feroz Avatar answered Nov 22 '22 08:11

Qammar Feroz