PHP code example of muscobytes / laravel-cdek-webhook

1. Go to this page and download the library: Download muscobytes/laravel-cdek-webhook 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/ */

    

muscobytes / laravel-cdek-webhook example snippets



return [
    'webhook_url' => env('CDEK_WEBHOOK_URL', '/api/cdek/webhook')
];



namespace App\Listeners;

use App\Jobs\CreateOrderFromPostingJob;
use Muscobytes\OzonSeller\Events\DownloadPhotoEvent;

class DownloadPhotoEventListener
{
    public function handle(
        DownloadPhotoEvent $event
    ): void
    {
        /** @var \Muscobytes\CdekWebhook\Messages\DownloadPhotoMessage $message */
        $message = $event->getMessage();
        // Ваш код
    }
}

class EventServiceProvider extends ServiceProvider
{
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
        OrderStatusEvent::class => [
            OrderStatusEventListener::class
        ]
    ];
bash
php artisan vendor:publish --provider="Muscobytes\CdekWebhook\CdekWebhookServiceProvider" --tag="config"
bash
php artisan make:listener DownloadPhotoListener