Hi, im getting a ''No property found for validation: [ColumnsToMap.id]'' hope you can help me out.
public function rules() { $columnRules = collect($this->requiredColumns) ->mapWithKeys(function ($column) { return ['ColumnsToMap.' . $column => ['required']]; }) ->toArray();
1 return array_merge($columnRules, [23 'file' => ['required', 'file', 'mimes:csv', 'max:51200'],45 ]);6}
Is ColumnsToMap
really in capital?
Thanks! 🤣
Instead of turning columnsToMap into a collection, mapping and using toArray, you could just use: array_fill_keys($this->columnsToMap, ‘’);
Can we use another file extension (xlsx,xls,ods) to import with LeagueCSV? I investigated and seems to me we can't ((. Maybe it possible to add this functionality by adding adapterÑŽ If we have other mime type (not CSV) then use another lib or smth like that)?
I have an issue: in CsvImporter.php in rules() method I try to define rule for file: 'file' => ['required', 'mimes:csv,xlsx,xls,ods', 'max:51200'] (the same as in cource), but this rule accept all mime type except csv ))). Anyone has an idea? P.S.: I use Ubuntu 20.04, Laravel 7 and php 7.4.
I find the answer: just add txt to mime types ---> 'mimes:csv,txt,xlsx,xls,ods',
Quick Tip:
If you want to make an invokable
controller, you may pass i
flag into the artisan command.
An example:
php artisan make:controller CustomerIndexController -i
or
php artisan make:controller CustomerIndexController --invoke
Will there be a source download available?
Usually source download is available after course is fully uploaded
Any ideas about how to auto detect the CSV format?
My CSV is splitted with ";" so I had to set in readCsv method
$csv->setDelimiter(';');
You can use the static Info-class that are in the League package
1$delimiters = Info::getDelimiterStats($csv, [',', ';'], 2);2if ($delimiters[';'] > 0)3 $csv->setDelimiter(';');
If I find any ; as delimiters, I set that as the default.
thanks for this course, by the way have no knowledge of javascript so that is why i'm choosing livewire to easy manage by using php laravel backend.
thanks for your work,,, i tried the code but the non-CSV file still uploaded event the validation shown an error. and i have question/requiest i am trying to make master/detail form with livewire ( like invoice with multiple lines of products ) with livewire is there any project avaible you recommend? thanks
I have a proplem with Horizon on windows,, is there any way to make run on window 11 or 10?