12

I want to show image in backend render list. For that how to get the path to show image. We have tried base_path() method.

But it gives me full path like "opt/lampp/htdocs/ashish/" but i want to get http://localhost/ashish

Ashish Detroja
  • 1,084
  • 3
  • 10
  • 32

4 Answers4

20

In twig you can do:

{{ url('/') }}
Will
  • 831
  • 1
  • 8
  • 13
7

Please use Request::getBaseUrl() for get base path like http://localhost/ashish

Ashish Detroja
  • 1,084
  • 3
  • 10
  • 32
5

You can use:

Config::get('app.url')

but first you have to properly configure your base path in app/config.php

I think is more general and you can also force the https if you need it.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
inalto
  • 161
  • 1
  • 2
0

This the way that I have tried & proved its working nicely when working with displaying images from media manager.

Config::get('cms.storage.media.path')
Tharanga
  • 47
  • 1
  • 6