'Linking image in SCSS for Laravel

I have code in SCSS:

$path-img : '../img';
@mixin background-images($img, $background-position, $background-repeat:no-repeat, $background-size:auto, $background-attachment:scroll, $background-color:transparent, $important) {
  /*background-image: url('#{$path-img}/#{$img}');
  background-repeat: $background-repeat;
  background-position: $background-position;
  background-size: $background-size;
  background-attachment: $background-attachment;*/
  background-color: $background-color ;
  background: url('#{$path-img}/#{$img}') $background-repeat $background-attachment $background-position $background-size $important;
}

but not think any error compile scss for relative or absolute link in url() function but why? I trying it ./ or ../ or ~/ but not correct path. :( but get address http://127.0.0.1/img/file.jpg is correct path but not in SCSS why?

My structure Laravel is default and any image is in "img" folder and copy all images in folder storage (this correct?) and copy all images in public folder. Where is started copy img and how correct write path in SCSS?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source