I am trying to import data from excel file. when i upload .csv file using livewire it convert to .txt file.
note: I am not sure if it is from Livewire or Laravel.
here is my modal code for importing file:
<x-jet-modal maxWidth="sm" wire:model="showImportDialog">
<form wire:submit.prevent="import" method="POST" enctype="multipart/form-data">
<div>
<div class="text-lg">Import Users</div>
</div>
<div>
<input type="file" wire:model="users" name="users" id="users" />
</div>
<x-jet-button type="submit">Import</x-jet-button>
</form>
</x-jet-modal>
and this is my livewire component:
...
use WithFileUploads;
public $users;
public function import()
{
dd($this->users); // originalName: "W4K99h75YVHSou815dV0fErWMLzZ75-metaUUNTX1VzZXJzXzIwMjEtMDktMTQgMTdfNDdfNTMuY3N2-.txt"
$validated = $this->validate([
'users.*' => 'required|file|mimes:xls,xlsx,csv',
]);
dd($validated); // it displays "[]"
}
...
when I dd() before validation shows this:
update 1:
when I did this:
dd($this->users->getClientOriginalName());
it shows:
Users_2021-09-14 17_47_53.csv
Update 2:
livewire config file:

