Help in laravel excel

0

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

    
asked by Juan Esteban Yarce 12.02.2018 в 20:33
source

2 answers

0

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)

Carbon Documentation

    
answered by 13.02.2018 / 21:18
source
1

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.

link

    
answered by 13.02.2018 в 04:55