Search
 
SCRIPT & CODE EXAMPLE
 

PHP

set image asset path in laravel

//Assets in app/public
// in image
<img src="{{URL::asset('/images/logo.jpg')}}"/>
// in div style
<div style="background-image: url({{URL::asset('images/image.jpg')}});">
</div>
Comment

laravel image path


You have to put all your assets in app/public folder, and to access them from your views you can use asset() helper method.

Ex. you can retrieve assets/images/image.png in your view as following:

<img src="{{asset('assets/images/image.png')}}">

this answer is from stack-overflow
by->Walid Ammar
Comment

Laravel update asset url

// Depending on what you want to achieve read below.
--
// This is how laravel asset reference works
asset() = "public/..."
// So the below example explains this
/* Implementation */ {{ asset('js/jquery.min.js') }} 
/* Output */ "public/js/jquery.min.js"
--
// This is how you can adjust the default asset path in Laravel
// Step 1 : Inside your .env file add this
ASSET_URL="custom/path/to/my/stuff/"
// Step 2 : Now with the above implemented when you use asset()
/* Implementation */ {{ asset('js/jquery.min.js') }} 
/* Output */ "custom/path/to/my/stuff/public/js/jquery.min.js"
Comment

laravel image path

<img src="{{ asset('storage/photo/'.$contact->photo) }}"  alt='{{$contact->photo}}' width="50px" height="50px" alt="">
Comment

PREVIOUS NEXT
Code Example
Php :: Notice: Undefined property: 
Php :: laravel blade auth user 
Php :: laravel blade time difference 
Php :: php curl pass user:password 
Php :: php quit 
Php :: php rename files in directory 
Php :: php konstanten 
Php :: php parse url get path 
Php :: php array common element 
Php :: wordpress wp_enqueue_script footer 
Php :: running a laravel app locally 
Php :: php header location not working 
Php :: smtp server xampp 
Php :: Get User IP address (PHP) 
Php :: php get values that exist in both arrays 
Php :: wp enqueue style for style.css 
Php :: get theme path wordpress dev 
Php :: sortbydesc on a collection laravel 
Php :: method put laravel 
Php :: SELECT query with PDO 
Php :: Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in 
Php :: eliminar ultimo caracter string php 
Php :: add script tag to wordpress Head 
Php :: http error code php 
Php :: get_transient wordpress 
Php :: update sql php 
Php :: php import python script 
Php :: random integer php 
Php :: program-generate-random-alphabets using php 
Php :: php artisan storage link cpanel 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =