Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

udy's avatar
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.

0 likes
0 replies

Please or to participate in this conversation.