https://github.com/escolalms/csv-users
This package is responsible for exporting and importing users in .csv format
https://github.com/escolalms/csv-users
api-rest csv laravel
Last synced: 3 months ago
JSON representation
This package is responsible for exporting and importing users in .csv format
- Host: GitHub
- URL: https://github.com/escolalms/csv-users
- Owner: EscolaLMS
- License: mit
- Created: 2021-12-14T10:35:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-24T11:42:50.000Z (12 months ago)
- Last Synced: 2025-04-16T22:25:37.140Z (3 months ago)
- Topics: api-rest, csv, laravel
- Language: PHP
- Homepage:
- Size: 14.6 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSV-Users
[](https://escolalms.github.io/CSV-Users/)
[](https://codecov.io/gh/EscolaLMS/CSV-Users)
[](https://github.com/EscolaLMS/CSV-Users/actions/workflows/test.yml)
[](https://packagist.org/packages/escolalms/CSV-Users)
[](https://packagist.org/packages/escolalms/CSV-Users)
[](https://packagist.org/packages/escolalms/CSV-Users)
[](https://codeclimate.com/github/EscolaLMS/CSV-Users/maintainability)
[](https://codeclimate.com/github/EscolaLMS/CSV-Users/test_coverage)## What does it do
This package is used to export and import users in the `.csv` format.
## Installation
- `composer require escolalms/csv-users`
- `php artisan db:seed --class="EscolaLms\CsvUsers\Database\Seeders\CsvUsersPermissionSeeder"`## Example
|id |name |first_name|last_name|email |country|is_active|created_at |onboarding_completed|email_verified|interests|avatar |roles |permissions |path_avatar |contact |bio |
|---|-----------------|----------|---------|------------------|-------|---------|---------------------------|--------------------|--------------|---------|---------------------------------------------------------------|---------|--------------------|----------------------|--------|----|
|16 |Valentine Wehnner|Valentine |Wehnner |[email protected]|Poland | |2021-10-14T15:50:28.000000Z|TRUE |TRUE |LMS |localhost/storage/avatars/16/logo.png |["tutor"]|["access dashboard"]|avatars/16/logo.png |1234567 |bio |- Export uses fields from `EscolaLms\Auth\Http\Resources\UserFullResource`
- Import uses the `update` or `create` method from `EscolaLms\Auth\Repositories\Contracts\UserRepositoryContract`.
If the email exists in the database, the user's data is updated. Otherwise, a new user is created.## Endpoints
All the endpoints are defined in [](https://escolalms.github.io/CSV-Users/)
## Tests
Run `./vendor/bin/phpunit` to run tests. Test details
[](https://codecov.io/gh/EscolaLMS/CSV-Users)
[](https://github.com/EscolaLMS/CSV-Users/actions/workflows/test.yml)## Events
- `EscolaLms\CsvUsers\Events\EscolaLmsImportedNewUserTemplateEvent` => Event is dispatched after importing a new user.
## How to use this on frontend
### Admin panel
**Import and export button**
## Permissions
Permissions are defined in [seeder](database/seeders/CsvUsersPermissionSeeder.php)