UserInfo.php 727 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Imports\User;
  3. use App\Models\User;
  4. use Maatwebsite\Excel\Concerns\WithBatchInserts;
  5. use Maatwebsite\Excel\Concerns\WithChunkReading;
  6. use Maatwebsite\Excel\Concerns\WithMultipleSheets;
  7. use Maatwebsite\Excel\Concerns\ToModel;
  8. use Maatwebsite\Excel\Concerns\SkipsUnknownSheets;
  9. class UserInfo implements WithMultipleSheets,WithBatchInserts,WithChunkReading
  10. {
  11. /**
  12. * @param array $row
  13. *
  14. * @return \Illuminate\Database\Eloquent\Model|null
  15. */
  16. public function sheets(): array
  17. {
  18. return [
  19. new UserSheet()
  20. ];
  21. }
  22. public function batchSize(): int
  23. {
  24. return 1000;
  25. }
  26. public function chunkSize(): int
  27. {
  28. return 1000;
  29. }
  30. }