Laravel: How to Route to Public file

后端 未结 2 950
萌比男神i
萌比男神i 2021-01-04 10:23

In Laravel, is it possible to redirect to a public/testFile.php, through routing?

In the application/routes.php,



        
2条回答
  •  甜味超标
    2021-01-04 10:33

    Route::get('/', function()
    {
        include public_path().'testFile.php';
    });
    

    If you want to Redirect then use return Redirect::to('testFile.php')

    But I don't get why you want to do this weird thing.

    I think you are using Laravel 3 (as you mentioned application/...), there public_path() is path('public').

提交回复
热议问题