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 Assets

// 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

PREVIOUS NEXT
Code Example
Php :: php ping 
Php :: composer_update 
Php :: carbon previous day 
Php :: foreach skip current iteration 
Php :: laravel redirect to controller method 
Php :: Laravel Excel numbers formatted as text still appearing as number 
Php :: php file extension 
Php :: Allowed memory size of 1610612736 bytes exhausted 4096 
Php :: wp post featured image not showing admin 
Php :: laravel auth without vue or bootstrap 
Php :: laravel command parameter optional 
Php :: laravel fortify 
Php :: convert time to 24 hour format laravel 
Php :: my vscode extension prettier doesnot work for php code 
Php :: php do not refresh page after submit post 
Php :: php if 
Php :: laravel guest blade 
Php :: laravel automatically generate unique username 
Php :: string to decimal php 
Php :: invalid_taxonomy 
Php :: Remove the Breadcrumbs on the Shop Entirely 
Php :: settimezone in php 
Php :: php secure password hash 
Php :: count an array in php 
Php :: compare dates datetime php 
Php :: php DateTime comparation 
Php :: php shorten string with dots 
Php :: php set environment variable 
Php :: input file accept jpg jpeg png php 
Php :: Laravel eloquent restore soft delete 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =