Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

584
Vistas
laravel asset() doesnt find assets in public

I already put the folder named assets in my public folder and I should be able to access the assets like described on this page: https://laravel.com/docs/9.x/helpers#method-asset

But for some reason It wont load and the browser console gives this error:

Loading failed for the “http://localhost:8000/assets/js/jquery-3.4.1.min.js” when this should be the exact path

In the blade file I wrote this:

<script src="{{asset ('assets/js/jquery-3.4.1.min.js') }}"></script>

I already tried with URL::asset and It doesnt find the file

I made the symbolic link 'links' => [ public_path('storage') => storage_path('app/public'),

The real path of the file is /home/penta/ponti-gest/storage/app/public/assets/js

In my page I am using http

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

Based on your comments:

I already have the folder assets in my public/storage folder

@GiuseppeP. Is the public/storage folder a symbolic link?

yes I made the symbolic link 'links' => [ public_path('storage') => storage_path('app/public'), ],

Your file is in the storage path.

This is accessible by using:

storage_path()

The storage_path function returns the fully qualified path to your application's storage directory. You may also use the storage_path function to generate a fully qualified path to a given file within the storage directory:

storage_path('app/public/assets/js/jquery-3.4.1.min.js')

Addendum

Alternatively, you can use the asset() helper by prefixing the path with storage/.... I.e:

The Public Disk

The public disk included in your application's filesystems configuration file is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores its files in storage/app/public.

Once a file has been stored and the symbolic link has been created, you can create a URL to the files using the asset helper:

asset('storage/assets/js/jquery-3.4.1.min.js')
about 4 years ago · Juan Pablo Isaza Denunciar

0

method asset() meaning go inside public folder so if it doesn't work

<script src="{{asset ('assets/js/jquery-3.4.1.min.js') }}"></script>

you should have in public folder assets folder then js folder then the file jquery-3.4.1.min.js

hopefully that help you

about 4 years ago · Juan Pablo Isaza Denunciar

0

you must set ASSET_URL in your .env file.

then run

php artisan config:cache
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda