laravel base path

后端 未结 3 1509
南笙
南笙 2021-02-07 14:21

Im using URL::base(); and I get this URL:

http://www.kp.com.mx/sis_colgate/public

but what I need is this complete path:

/home/         


        
相关标签:
3条回答
  • 2021-02-07 14:41

    you can find info about paths in documentation:

    • Laravel 6
    • Laravel 5
    • Laravel 4
    0 讨论(0)
  • 2021-02-07 14:47

    What you want to use is the path helper.

    The URL helper is for generating HTTP URLs.

    Try the path('public') function in Laravel 3,

    or the public_path() function in Laravel 4.

    Edit: Updated with answer for Laravel 4, thanks Erin

    0 讨论(0)
  • 2021-02-07 14:47

    Laravel has helpers for paths:

    base_path();    // '/var/www/mysite'
    app_path();     // '/var/www/mysite/app'
    storage_path(); // '/var/www/mysite/storage'
    
    0 讨论(0)
提交回复
热议问题