/
ouadad.txt
73 lines (51 loc) · 2.05 KB
/
ouadad.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************** #1: Laravel Excel Export data in Excel, CSV & multiple sheet export /*****************
- maatwebsite/excel installation
- artisan make:export & export users data into the excel
- Exportable trait
- Responsable interface
- method/constructor dependency injection for Excel Class
- Export formats (XLSX, XLS, CSV etc)
- Export in PDF using DOMPDF
- Export excel using arrays
- Excel export from Laravel blade view
- Auto size excel cell width
- Mapping data
- export data from the model relationship (for example User & Address model relationship)
- add a heading row in excel
- events & format cell in excel (eg: bold, border, color, etc)
- export large data using `FromQuery` interface (Behind the scenes this query is executed in chunks).
- display logo in excel sheet using `WithDrawings` interface
- custom start cell
- Laravel excel multiple sheets export example
- Storing exports on disk
_______________________________________
https://docs.laravel-excel.com/3.1/getting-started/installation.html
1) composer require maatwebsite/excel
https://docs.laravel-excel.com/3.1/exports/
2) php artisan make:export UsersExport --model=User
3) php artisan make:controller UsersExportController
/***************** #2: Laravel Excel Import to Database with Errors and Validation Handling /*****************
- artisan make:import & import users data in the database
- import route and form to upload excel file
- Import excel file content into Database
- `Importables` trait
- `WithHeadingRow` interface to handle headings in excel file
- Handling Errors
- Handling validation errors
- Batch inserts
- Chunk reading
- Queued imports
- Import relationship model
- `afterImport` Event
https://docs.laravel-excel.com/3.1/imports/
1) php artisan make:import UsersImport --model=User
2) php artisan make:controller UserImportController
...
...
/*********** Queued imports /***********
1) fichier env.
QUEUE_CONNECTION=sync =======> QUEUE_CONNECTION=database
2) php artisan queue:table
3) php artisan migrate:refresh
4) php artisan serve
5) php artisan queue:work