Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

php laravel asset 获取路径的问题

使用 php -S localhost:8000 public启动项目,发现无法加载resources/views/index.blade.php中热asset函数路径里的文件。
例如 asset('public/js/jquery-3.3.1.js')
看了一下,如果改为asset('js/jquery-3.3.1.js')就可以了,所以有没有什么方法能够不改变代码中路径,统一把asset()的默认路径改掉吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你asset里面本身就不应该带public


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...