In Laravel pacakage development, the asset() function is not working. How can I properly use it? I also need to get the URL path of the public folder.
2 Answers
Go .env File
APP_URL=http://127.0.0.1:8000
Using Config Path
return config('app.url').'/images/avatar-male.png';
1 Comment
Community
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
public_path()assetfunction?