amphibee/studizz

A Laravel package to interact with the Studizz API

dev-main 2024-10-11 14:29 UTC

This package is auto-updated.

Last update: 2024-10-31 16:59:49 UTC


README

This package provides a convenient way to interact with the Studizz API in Laravel applications.

Installation

You can install the package via composer:

composer require amphibee/studizz

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="AmphiBee\Studizz\Providers\StudizzServiceProvider"

Add your Studizz API credentials to your .env file:

STUDIZZ_API_KEY=your_api_key
STUDIZZ_BASE_URL=https://sandbox.studizz.fr/api

Usage

This package provides two main services: ContactService and FormationService. You can access these services through the Studizz facade.

Contacts

Create a Contact

use AmphiBee\Studizz\Facades\Studizz;
use AmphiBee\Studizz\Dto\ContactDto;

$contactData = [
    'firstname' => 'John',
    'lastname' => 'Doe',
    'email' => 'john.doe@example.com',
    'phone' => '+33612345678',
    'degreeLevel' => 0,
    'teamAssigned' => '63e26d24383062596b949cff',
    'interestedFormations' => ['5bdeb73136da49690e78c510'],
    'rgpd' => true,
    'cV' => [
        'file' => file_get_contents('/path/to/file.pdf'),
        'filename' => 'file.pdf',
    ];
];

$contactDto = new AmphiBee\Studizz\Dto\ContactDto($contactData);

$newContact = AmphiBee\Studizz\Facades\Contact::create($contactDto);

Get Contact Fields

$fields = AmphiBee\Studizz\Facades\Contact::getFields();

Formations

Get All Formations

$formations = AmphiBee\Studizz\Facades\Formation::getAll();

Campus

Get All Campus

$formation = AmphiBee\Studizz\Facades\Campus::getAll();

Testing

To run the tests for this package, use the following command:

./vendor/bin/pest

Contributing

Please see CONTRIBUTING.md for details.

Security

If you discover any security-related issues, please email security@amphibee.fr instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.