Skip to content

Commit 39e9cf8

Browse files
Merge pull request SpartnerNL#55 from ddawsari/master
docs: Add RTL support part
2 parents a4e7497 + d6c0d13 commit 39e9cf8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

3.1/exports/extending.md

+26
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,32 @@ class InvoicesExport implements WithEvents
280280
}
281281
}
282282
```
283+
### RTL (Right to Left) Sheets
284+
285+
To change the excel sheet direction you can use `setRightToLeft(true)` as in the below example
286+
287+
```php
288+
namespace App\Exports;
289+
290+
use Maatwebsite\Excel\Concerns\WithEvents;
291+
use Maatwebsite\Excel\Events\BeforeExport;
292+
use Maatwebsite\Excel\Events\AfterSheet;
293+
294+
class InvoicesExport implements WithEvents
295+
{
296+
/**
297+
* @return array
298+
*/
299+
public function registerEvents(): array
300+
{
301+
return [
302+
AfterSheet::class => function(AfterSheet $event) {
303+
$event->sheet>getDelegate()->setRightToLeft(true);
304+
},
305+
];
306+
}
307+
}
308+
```
283309

284310
Feel free to use the above macro, or be creative and invent your own!
285311

0 commit comments

Comments
 (0)