You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-31
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
-[License](#license)
28
28
29
29
## Introduction
30
-
__Laravel CSV__ Package is a package created on top of Laravel [livewire](https://laravel-livewire.com)package, and it handles importing thousands of records without any issues.
30
+
__Laravel CSV__ Package is a package created on top of Laravel [livewire](https://laravel-livewire.com)for easily handling imports with a simple API.
| This package came with file validation for uploaded files,
80
-
| and by default the file should not be greater than 20MB. If
81
-
| you wish to increase/decrease this value, you may change the
82
-
| value below.
83
-
| Note that the value is defined by "KB".
77
+
| The default maximumum file size that can be imported by this
78
+
| package is 20MB. If you wish to increase/decrease this value,
79
+
| change the value in KB below.
84
80
|
85
81
*/
86
82
'file_upload_size' => 20000,
87
83
];
88
84
```
89
85
90
-
The `layout` option is for choosing which CSS Framework you are using, currently supports only `tailwindcss`, and we're working on other CSS frameworks to implement in the future.
86
+
The `layout` option is for choosing which CSS framework you are using and currently supports only `tailwindcss`. We are working on other CSS frameworks to implement in the future.
91
87
92
-
The `file_upload_size` is for validation rules, and it helps define the file size of the uploaded files, or. You can define this one from [livewire config](https://github.com/livewire/livewire/blob/master/config/livewire.php#L100) file.
88
+
The `file_upload_size` is for validation rules, and it defines the maximum file size of uploaded files. You may also define this value from the[livewire config](https://github.com/livewire/livewire/blob/master/config/livewire.php#L100) file.
@@ -118,19 +114,19 @@ Using this package, is really simple, all what you need to do is implementing th
118
114
119
115
| Props | Type | Description |
120
116
|---|---|---|
121
-
| model |`string`| Fully qualified name of the model wants to import to |
122
-
| columns-to-map |`array`|Accept Columns need to be imported in the db |
123
-
| required-columns |`array`|Accept Columns need to be required while importing|
124
-
| columns-label |`array`|Accept Column Label of the required columns for the message|
117
+
| model |`string`| Fully qualified name of the model you wish to import to |
118
+
| columns-to-map |`array`|Column names in the target database table|
119
+
| required-columns |`array`| Columns that are required by validation for import|
120
+
| columns-label |`array`| Display labels for the required columns |
125
121
126
122
### Button Component
127
-
The Component using`alpinejs` under the hood, If you want to use the import button, you may use`x-csv-button` component.
123
+
The Component uses`alpinejs` under the hood. To display an import button, include the`x-csv-button` component.
128
124
129
125
```blade
130
126
<x-csv-button>Import</x-csv-button>
131
127
```
132
128
133
-
If you want to style it, you may use the `class` attribute, or any attribute you want.
129
+
To style the button, use the `class` attribute with Tailwind utility classes.
134
130
135
131
```blade
136
132
<x-csv-button
@@ -141,18 +137,18 @@ If you want to style it, you may use the `class` attribute, or any attribute you
141
137
</x-csv-button>
142
138
```
143
139
### In TALL stack project
144
-
If you are using this package in a [TALL Stack](https://tallstack.dev/) project, (Tailwindcss, Alpinejs, Laravel, Livewire) All what you need to do is publish the vendor views
140
+
If you are using this package in a [TALL Stack](https://tallstack.dev/) project, (Tailwindcss, Alpinejs, Laravel, Livewire) publish the vendor views to include Laravel-CSV in your project.
145
141
146
142
```bash
147
143
php artisan vendor:publish --tag="csv-views"
148
144
```
149
-
Then compile your assets, to add the additional classes, came with the component.
145
+
Then compile your assets.
150
146
```bash
151
147
npm run dev
152
148
```
153
149
154
150
### In none TALL Stack project
155
-
If you are not using the TALL Stack by default, you may use the `csv directives` to add the necessary styles/scripts
151
+
If you are not using the TALL Stack, use the `csv directives` to add the necessary styles/scripts.
156
152
157
153
```blade
158
154
<html>
@@ -170,19 +166,19 @@ If you are not using the TALL Stack by default, you may use the `csv directives`
170
166
171
167
```
172
168
### Using Queues
173
-
This package is using [queues](https://laravel.com/docs/9.x/queues#main-content), under the hood with [PHP Generators](https://www.php.net/manual/en/language.generators.overview.php), to make it works fast and efficient.
169
+
This package uses [queues](https://laravel.com/docs/9.x/queues#main-content) under the hood with [PHP Generators](https://www.php.net/manual/en/language.generators.overview.php) to make it fast and efficient.
174
170
175
-
You need first to create the `batches table`
171
+
Create the `batches table` by running
176
172
```bash
177
173
php artisan queue:batches-table
178
174
```
179
-
Then run the migration
175
+
Then, run the migration.
180
176
```
181
177
php artisan migrate
182
178
```
183
179
184
-
After that, you need to set up the queues' configuration.
185
-
You may head into[Laravel Queues Documentation](https://laravel.com/docs/9.x/queues#main-content) to learn more.
180
+
After that, set up the queues' configuration.
181
+
Head to[Laravel Queues Documentation](https://laravel.com/docs/9.x/queues#main-content) to learn more.
186
182
187
183
188
184
## Testing
@@ -204,7 +200,7 @@ Please see [CONTRIBUTING](https://github.com/ousid/.github/blob/main/CONTRIBUTIN
204
200
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
205
201
206
202
## Inspiration
207
-
This Package Was Inspired by [codecourse](https://codecourse.com) video series, and if you want to learn how this package was created, make sure to take a look at this [video series](https://codecourse.com/subjects/laravel-livewire)
203
+
This Package Was Inspired by [codecourse](https://codecourse.com) video series. If you want to learn how this package was created, make sure to take a look at this [video series](https://codecourse.com/subjects/laravel-livewire)
0 commit comments