How to redirect to public in laravel?

Member

by dana , in category: Third Party Scripts , 19 hours ago

How to redirect to public in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 3 hours 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.