GeekDaddy
GeekDaddy

Reputation: 619

Copying Excel from Template xls

I have a template xls to which I write some data. This template needs to be saved in different folder under different name. Here is code I use:

        Excel::load('template.xls', function($excel) use($order) {
            // Writing stuff

        })->store('xls', public_path('exports'));

How do I change this code to write file under different name? I now it's trivial but I couldn't find it in documentation.

Upvotes: 0

Views: 206

Answers (1)

lukasgeiter
lukasgeiter

Reputation: 152900

Haven't tested it but try this:

Excel::load('template.xls', function($excel) use($order) {
        // Writing stuff

})->setFileName('new-filename')->store('xls', public_path('exports'));

Note that you shouldn't need to specify an file extension

Upvotes: 1

Related Questions