Laravel: Get base url

后端 未结 17 1982
梦谈多话
梦谈多话 2020-12-07 10:09

Simple question, but the answer seems quite hard to come by. In Codeigniter, I could load the url helper and then simply do

echo base_url();
<
17条回答
  •  日久生厌
    2020-12-07 10:42

    I used this and it worked for me in Laravel 5.3.18:

    
    

    IMPORTANT NOTE: This will only work when you have already removed "public" from your URL. To do this, you may check out this helpful tutorial.

提交回复
热议问题