PHP code example of amphibee / studizz

1. Go to this page and download the library: Download amphibee/studizz library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amphibee / studizz example snippets


use AmphiBee\Studizz\Facades\Contact;
use Illuminate\Support\Facades\Log;

try {
    $contactData = [
        'firstname' => 'John',
        'lastname' => 'Doe',
        // ... autres données
    ];
    
    $contactDto = new ContactDto($contactData);
    $newContact = Contact::create($contactDto);
    
    // Log the raw response
    Log::channel('api')->info('Studizz API Response', [
        'response' => Contact::getRawResponse()
    ]);
    
} catch (\Exception $e) {
    Log::channel('api')->error('Studizz API Error', [
        'message' => $e->getMessage(),
        'trace' => $e->getTraceAsString()
    ]);
}

'channels' => [
    // ... autres canaux
    
    'api' => [
        'driver' => 'daily',
        'path' => storage_path('logs/api.log'),
        'level' => env('LOG_LEVEL', 'debug'),
        'days' => 14,
    ],
],

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

$contactData = [
    'firstname' => 'John',
    'lastname' => 'Doe',
    'email' => '[email protected]',
    '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();
bash
php artisan vendor:publish --provider="AmphiBee\Studizz\Providers\StudizzServiceProvider"
log
[2024-03-14 10:30:00] local.INFO: Studizz API - Données d'entrée {"data":{"firstname":"John","lastname":"Doe",...}}
[2024-03-14 10:30:01] local.INFO: Studizz API - Réponse {"response":{"id":"123",...}}