0
我有這樣的代碼在laravel出口擅長:如何從Laravel 5.1獲得下載文件,AngularJS和UI路由器
public function export_excel(Request $request){
$user = user::all();
Excel::create('user', function($excel) use($user) {
$excel->sheet('Sheet 1', function($sheet) use($user) {
$sheet->fromArray($user);
});
})->download('xls');
}
,我的路線是:
Route::get('user/export/excel','[email protected]_excel');
和我的HTML是:
<a><i class="fa fa-file-excel-o"></i> Export to Excel</a>
我想給從REST API請求與Restangular
並獲得下載文件之後。
在SPA的應用程序直接指向API是不是一個好的做法! – Fara