1

laravel을 api로 사용하고 프런트 엔드로 각도를 사용하려고 시도하면서 공용 폴더에 대한 내 경로 액세스를 시도하고 있습니다. 나는 내가보기 폴더를 생성 한 내 공용 폴더에Laravel 5.2보기가 공용 ​​폴더로 설정되었습니다.

'paths' => [ 
    realpath(base_path('public/views')), 
], 

'paths' => [ 
    realpath(base_path('resources/views')), 
    ], 

에서 config 폴더에서보기 파일을 변경하고라는 파일을 지금 test.html를

Route::get('/',function(){ 

return view('test.html'); 

}); 
에 놓여있다

오류를 보여줍니다

in FileViewFinder.php line 137 
at FileViewFinder->findInPaths('test.html', array('C:\xampp\htdocs\customer_portal\public\views')) in FileViewFinder.php line 79 
at FileViewFinder->find('test.html') in Factory.php line 165 
at Factory->make('test.html', array(), array()) in helpers.php line 779 
at view('test.html') in routes.php line 36 
at RouteServiceProvider->{closure}() 

내가 뭘 잘못하고 있는지 알아?

+0

질문에 솔루션을 편집하지 마십시오 대신 파일의 conent를 반환 (코드 아래 내 프로젝트 FilesController에서 붙여 넣기를 복사) . 대신 아래에 별도의 답변으로 게시하십시오. http://stackoverflow.com/help/self-answer를 참조하십시오. – Matt

답변

0

문제는 U가 HTML 파일에서 뷰 ('test.html')를 반환한다는 것입니다. 그것의 잘못,보기는 PHP 블레이드 템플릿을 사용해야합니다.

use Response; 
... 

public function downloadFile(Request $request) 
{ 

    ... 

    return Response::download(path_to_your_file, download_file_name); 

} 

대신 Route::get('/',function(){... 넣어의 routes.php 파일 :

Route::get('/', '[email protected]'); 
관련 문제