amphibee/studizz

Laravel 包用于与 Studizz API 交互

dev-main 2024-09-12 05:21 UTC

This package is auto-updated.

Last update: 2024-09-26 14:19:44 UTC


README

此包为 Laravel 应用程序提供了一种方便的方式与 Studizz API 交互。

安装

您可以通过 composer 安装此包

composer require amphibee/studizz

配置

发布配置文件

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

将您的 Studizz API 凭据添加到 .env 文件中

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

使用方法

此包提供两个主要服务:ContactServiceFormationService。您可以通过 Studizz 门面访问这些服务。

联系人

创建联系人

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);

获取联系人字段

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

培训

获取所有培训

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

校园

获取所有校园

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

测试

要为此包运行测试,请使用以下命令

./vendor/bin/pest

贡献

有关详细信息,请参阅 CONTRIBUTING.md

安全

如果您发现任何与安全相关的问题,请通过电子邮件 security@amphibee.fr 而不是使用问题跟踪器来报告。

致谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件