Skip to content

Commit 900a850

Browse files
authored
Merge pull request #2 from johnwesely/main
Phrasing.
2 parents eb2d41c + 209cc87 commit 900a850

File tree

2 files changed

+32
-42
lines changed

2 files changed

+32
-42
lines changed

Diff for: README.md

+27-31
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- [License](#license)
2828

2929
## 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.
3131

3232
## Installation
3333

@@ -39,20 +39,20 @@ composer require coderflex/laravel-csv
3939

4040
## Configuration
4141

42-
You can publish and run the migrations with:
42+
Publish and run the migrations with:
4343

4444
```bash
4545
php artisan vendor:publish --tag="csv-migrations"
4646
php artisan migrate
4747
```
4848

49-
You can publish the config file with:
49+
Publish the config file with:
5050

5151
```bash
5252
php artisan vendor:publish --tag="csv-config"
5353
```
5454

55-
This is the contents of the published config file:
55+
The following is the contents of the published config file:
5656

5757
```php
5858

@@ -63,10 +63,8 @@ return [
6363
| Default Layout
6464
|--------------------------------------------------------------------------
6565
|
66-
| This package came with multiple layouts to serve your need, and
67-
| currently it supports "tailwindcss" and "bootstrap", by default
68-
| the layout is tailwind.
69-
| currently support: "tailwindcss"
66+
| This package plans on supporting multiple CSS frameworks.
67+
| Currently, 'tailwindcss' is the default and only supported framework.
7068
|
7169
*/
7270
'layout' => 'tailwindcss',
@@ -76,20 +74,18 @@ return [
7674
| Max Upload File Size
7775
|--------------------------------------------------------------------------
7876
|
79-
| 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.
8480
|
8581
*/
8682
'file_upload_size' => 20000,
8783
];
8884
```
8985

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.
9187

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.
9389

9490
Optionally, you can publish the views using
9591

@@ -102,7 +98,7 @@ php artisan vendor:publish --tag="csv-views"
10298
## Usage
10399

104100
### CSV Importer Component
105-
Using this package, is really simple, all what you need to do is implementing the component inside your desired file.
101+
Using this package is a breeze. To implmenent the importer in your project, simply include the following component inside a Blade view.
106102

107103
```blade
108104
<livewire:csv-importer :model="App\Models\YourModel::class"
@@ -118,19 +114,19 @@ Using this package, is really simple, all what you need to do is implementing th
118114

119115
| Props | Type | Description |
120116
|---|---|---|
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 |
125121

126122
### 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.
128124

129125
```blade
130126
<x-csv-button>Import</x-csv-button>
131127
```
132128

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.
134130

135131
```blade
136132
<x-csv-button
@@ -141,18 +137,18 @@ If you want to style it, you may use the `class` attribute, or any attribute you
141137
</x-csv-button>
142138
```
143139
### 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.
145141

146142
```bash
147143
php artisan vendor:publish --tag="csv-views"
148144
```
149-
Then compile your assets, to add the additional classes, came with the component.
145+
Then compile your assets.
150146
```bash
151147
npm run dev
152148
```
153149

154150
### 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.
156152

157153
```blade
158154
<html>
@@ -170,19 +166,19 @@ If you are not using the TALL Stack by default, you may use the `csv directives`
170166
171167
```
172168
### 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.
174170

175-
You need first to create the `batches table`
171+
Create the `batches table` by running
176172
```bash
177173
php artisan queue:batches-table
178174
```
179-
Then run the migration
175+
Then, run the migration.
180176
```
181177
php artisan migrate
182178
```
183179

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.
186182

187183

188184
## Testing
@@ -204,7 +200,7 @@ Please see [CONTRIBUTING](https://github.com/ousid/.github/blob/main/CONTRIBUTIN
204200
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
205201

206202
## 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)
208204

209205
## Credits
210206

Diff for: config/laravel_csv.php

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
<?php
2-
31
return [
42

53
/*
64
|--------------------------------------------------------------------------
75
| Default Layout
86
|--------------------------------------------------------------------------
97
|
10-
| This package came with multiple layouts to serve your need, and
11-
| currently it supports "tailwindcss" and "bootstrap", by default
12-
| the layout is tailwind.
13-
| currently support: "tailwindcss"
8+
| This package plans on supporting multiple CSS frameworks.
9+
| Currently, 'tailwindcss' is the default and only supported framework.
1410
|
1511
*/
1612
'layout' => 'tailwindcss',
@@ -20,11 +16,9 @@
2016
| Max Upload File Size
2117
|--------------------------------------------------------------------------
2218
|
23-
| This package came with file validation for uploaded files,
24-
| and by default the file should not be greater than 20MB. If
25-
| you wish to increase/decrease this value, you may change the
26-
| value below.
27-
| Note that the value is defined by "KB".
19+
| The default maximumum file size that can be imported by this
20+
| package is 20MB. If you wish to increase/decrease this value,
21+
| change the value in KB below.
2822
|
2923
*/
3024
'file_upload_size' => 20000,

0 commit comments

Comments
 (0)