msslgomez
1 week ago

Take into account duplicate names when saving excels

Posted 1 week ago by msslgomez

I created a job to create and store excel files to the server but these excel files can have the same names as it's a report for a survey and the survey's name can repeat themselves, the excel files only save one per name, how can I fix that to either change the excel name or ignore that and save duplicated anyway.

I'm simply creating the excel like this, how can I check for the file and alter the name so it saves as many excels duplicates are there are?

$name = str_replace(':', '', $items->name);
Excel::store(new SurveyReport($items), $name . '.xlsx', 'report_upload');

Please sign in or create an account to participate in this conversation.