Nov 2, 2018
0
Level 1
Route Nova "Tool" form
Im trying to create a Nova Tool for the user to upload an excel file. Im using maatwebsite/laravel-nova-excel package for excel bit. Assuming that bit works, who could I post input file to a method in controller?
My Tool.vue;
" Station Importer
<card class="bg-90 flex flex-col items-center justify-center" style="min-height: 300px">
<h1 class="text-white text-4xl text-90 font-light mb-6">
Upload re fulling stations
</h1>
<p class="text-white-50% text-lg">
<form method="POST" action="/importStations">
<input type="file" name="stations-doc"/>
<input type="hidden" name="_token" :value="csrf" value="PATCH">
<input type="submit" value="upload"/>
</form>
</p>
</card>
</div>
export default {
data() {
return {
csrf: document.querySelector('meta[name="csrf-token"]').getAttribute('content')
}
},
mounted() {
//
},
}
"
routes>api.php in nova-components
"Route::post('/importStations', 'StationImporterController@importStations');"
I got to the point that I can see the form where the document needs to get uploaded but the submission of the form is where Im struggling with.
Please or to participate in this conversation.