escolalms/csv-users

Escola Headless LMS CSV Users

Installs: 8 891

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:package

0.1.16 2024-02-05 13:58 UTC

README

swagger codecov phpunit downloads downloads downloads Maintainability 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

  • 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 swagger

Tests

Run ./vendor/bin/phpunit to run tests. Test details codecov phpunit

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 Import / export button

Permissions

Permissions are defined in seeder