Search
 
SCRIPT & CODE EXAMPLE
 

PHP

asset not working in laravel

Add this in your .htaccess file

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]

    RewriteCond %{REQUEST_URI} (.w+$) [NC]
    RewriteRule ^(.*)$ public/$1 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php
</IfModule>
Comment

asset function in laravel not working

php artisan cache:clear
php artisan route:cache
php artisan config:cache
php artisan view:clear
Comment

asset function in laravel not working

if (! function_exists('asset')) {
    /**
     * Generate an asset path for the application.
     *
     * @param  string  $path
     * @param  bool    $secure
     * @return string
     */
    function asset($path, $secure = null)
    {
        return app('url')->asset("public/".$path, $secure);
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel loop through collection 
Php :: php format int to 9 digits with preceding zeroes 
Php :: wordpress get permalink in loop 
Php :: return back in laravel 
Php :: fix excel file wrong language php 
Php :: how to remove public from url in laravel 8 
Php :: php from 
Php :: bind in pdo 
Php :: order by sum() laravel 
Php :: php json request get value 
Php :: Get Parameters From a URL String in PHP 
Php :: get table name of model laravel 
Php :: php validate only numbers 
Php :: add column in laravel migration 
Php :: remove 1 day from date in php 
Php :: php get all saturdays in a month 
Php :: laravel send ajax 
Php :: csv to array in php 
Php :: convert text to slug php 
Php :: auth guard api is not defined laravel 8 
Php :: eloquent where in 
Php :: remove .php from url 
Php :: toaster message in laravel 
Php :: Add 5 days to the current date in PHP 
Php :: add field to many to many relationship laravel 
Php :: php array remove value if exists 
Php :: laravel transform object to array 
Php :: php pdo select 
Php :: how to create a logout button in wordpress 
Php :: yii2 pjax 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =