2020年12月23日星期三

Posting object with Vue for Maatwerk Laravel Excel export

I'm a bit stuck right now. I want to create an export using Maatwerk Laravel-Excel. The user must be able to set some filters. In Vue I will set the selected values when selected. When the button is pressed the user must receive the download.

In Vue:

data() {          return {              selected: {                  manufacturers: [],                  categories: [],                  seasons: [],                  date: null              }          };      },      methods: {          exportClick() {              axios.post('/export/', this.selected)              .then(function (response) {                     })              .catch(function (error) {                    });          },      }  

In the Controller:

public function export(Request $request)  {      $name = "test.xlsx";      return Excel::download(new Export($manufacturers, $categories, $seasons, $date), $name);  }  

I'm kind of new to developing and I don't know how to access the variables inside the request. I'm also wondering if the download will start with axios. Can somebody help me with this issue?

https://stackoverflow.com/questions/65431267/posting-object-with-vue-for-maatwerk-laravel-excel-export December 24, 2020 at 05:41AM

没有评论:

发表评论