How to redirect to public in laravel?

Member

by dana , in category: Third Party Scripts , 6 months ago

How to redirect to public in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 6 months ago

@dana 

To redirect to a public folder in Laravel, you can use the asset() helper function or the url() helper function.


Here is an example:

1
return redirect(asset('path/to/file'));


or

1
return redirect(url('path/to/file'));


Replace 'path/to/file' with the actual path to the file or resource in the public folder that you want to redirect to.

Related Threads:

How to redirect public to non public url with .htaccess?
How to remove public from url in laravel?
How to save download zip to public folder in laravel?
How to run wordpress inside public folder in laravel?
How to load images stored outside 'public' folder laravel?
How to redirect with id in laravel?