I would like to know how I can place dates to the names of the excel documents in laravel to be able to know on which day the file was exported I would appreciate your collaboration
I would like to know how I can place dates to the names of the excel documents in laravel to be able to know on which day the file was exported I would appreciate your collaboration
To do anything with dates I recommend you use Carbon.
When you create the name of the excel you add the date and that's it.
use Carbon\Carbon;
$name ='Filtro de Precebo por Granja y Lote'.Carbon::now();
o
$name ='Filtro de Precebo por Granja y Lote'.Carbon::now('Europe/Madrid');
Excel::create($name , function($excel) use($gr, $lote)
Because you do not apply to concatenate the date
Excel::create('Filtro de Precebo por Granja y Lote'.date('Ymd'), function($excel) use($gr, $lote)
Where date('Ymd')
returns the yearMesDay string.