SpartnerNL / Laravel-Nova-Excel

🚀 Supercharged Excel exports for Laravel Nova Resources
https://docs.laravel-excel.com/nova/1.0/
MIT License
382 stars 74 forks source link

[BUG] only index items are translated in export #53

Open dakira opened 5 years ago

dakira commented 5 years ago

Prerequisites

Versions

Description

The export picks up on translated fields like this:

public function fields(Request $request)
{
    return [
        Text::make(__('Company'), 'company'),
        Text::make(__('Lastname'), 'lastname')->sortable()
            ->rules('required', 'max:255'),
        Text::make(__('Firstname'), 'firstname')
    ]
}

They show up translated in the excel file, but only when they are on the index. For fields that are excluded from the index no translation is shown.

patrickbrouwers commented 5 years ago

Hey @dakira can you show the code you have for the export action?