PHPackages                             szhorvath/laravel-cloudflare-stream - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. szhorvath/laravel-cloudflare-stream

ActiveLibrary

szhorvath/laravel-cloudflare-stream
===================================

This is my package laravel-cloudflare-stream

030[4 PRs](https://github.com/szhorvath/laravel-cloudflare-stream/pulls)PHPCI passing

Since Oct 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/szhorvath/laravel-cloudflare-stream)[ Packagist](https://packagist.org/packages/szhorvath/laravel-cloudflare-stream)[ RSS](/packages/szhorvath-laravel-cloudflare-stream/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

This is my package laravel-cloudflare-stream
============================================

[](#this-is-my-package-laravel-cloudflare-stream)

[![Latest Version on Packagist](https://camo.githubusercontent.com/889565aa71d3536e778c14da9558684f43dc7e225073f1f7fb2916ef4e1ae678/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737a686f72766174682f6c61726176656c2d636c6f7564666c6172652d73747265616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/szhorvath/laravel-cloudflare-stream)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f29f82d0d3edda371124a56b1da9455e731e03bfe9e6b09024122db0c681ef21/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737a686f72766174682f6c61726176656c2d636c6f7564666c6172652d73747265616d2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/szhorvath/laravel-cloudflare-stream/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/bf7131822102483b7dbd449289ac4188253e58bc13a3f6595a89e19a8bf3c384/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737a686f72766174682f6c61726176656c2d636c6f7564666c6172652d73747265616d2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/szhorvath/laravel-cloudflare-stream/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/13cbd8bac28f08ad18ea3840354bfb1263c6dfd7541cba065fdff340bd3a0674/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737a686f72766174682f6c61726176656c2d636c6f7564666c6172652d73747265616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/szhorvath/laravel-cloudflare-stream)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/806ea15986082f56067992b698d325af7484c0af8b5f85a48a4414d3c1c3bc06/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d636c6f7564666c6172652d73747265616d2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-cloudflare-stream)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require szhorvath/laravel-cloudflare-stream
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="cloudflare-stream-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="cloudflare-stream-config"
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | API Token
    |--------------------------------------------------------------------------
    |
    | The API token used to authenticate with the Cloudflare Stream API.
    | @see https://dash.cloudflare.com/profile/api-tokens
    |
    */
    'api_token' => env('CLOUDFLARE_STREAM_API_TOKEN', ''),

    /*
    |--------------------------------------------------------------------------
    | Account ID
    |--------------------------------------------------------------------------
    |
    | The account ID used to authenticate with the Cloudflare Stream API.
    |
    */
    'account_id' => env('CLOUDFLARE_STREAM_ACCOUNT_ID', ''),

    /*
    |--------------------------------------------------------------------------
    | Base URL
    |--------------------------------------------------------------------------
    |
    | The base URL used with the Cloudflare Stream API.
    |
    */
    'base_url' => env('CLOUDFLARE_STREAM_BASE_URL', 'https://api.cloudflare.com/client/v4/'),

    /**
    |--------------------------------------------------------------------------
    | Customer Subdomain
    |--------------------------------------------------------------------------
    |
    | This domain is specific to your Cloudflare account.
    | Use it for all requests to fetch video manifests, thumbnails and embed codes.
    |
     */
    'customer_subdomain' => env('CLOUDFLARE_STREAM_CUSTOMER_SUBDOMAIN', 'customer-.cloudflarestream.com'),

    /*
    |--------------------------------------------------------------------------
    | Signing Key ID
    |--------------------------------------------------------------------------
    | This is the signing Key ID to generate tokens for signed URLs
    | @see https://developers.cloudflare.com/stream/viewing-videos/securing-your-stream/#option-2-generating-signed-tokens-without-calling-the-token-endpoint
    |
    */
    'key_id' => env('CLOUDFLARE_STREAM_KEY_ID', ''),

    /*
    |--------------------------------------------------------------------------
    | Signing key PEM
    |--------------------------------------------------------------------------
    |
    | This is the signing RSA private key in PEM format to generate tokens for signed URLs
    | @see https://developers.cloudflare.com/api/operations/stream-signing-keys-create-signing-keys
    |
    */
    'pem' => env('CLOUDFLARE_STREAM_KEY_PEM', ''),

    /*
    |--------------------------------------------------------------------------
    | Default Options
    |--------------------------------------------------------------------------
    |
    | This is the default options that will be applied to all upload
    | The `thumbnailTimestampPct` is a floating point value between 0.0 and 1.0.
    | All the commented defaults here don't seem to work for uploading via link
    |
    */
    'default_options' => [
        'requireSignedURLs' => true,
        //'allowedOrigins' => [],
        //'thumbnailTimestampPct' => 0.0
    ],

    /*
    |--------------------------------------------------------------------------
    | Webhook
    |--------------------------------------------------------------------------
    |
    | Cloudflare stream webhook configuration.
    | This configuration will be merged with the Spatie Laravel Webhook Client - webhook-client configuration.
    | @see https://github.com/spatie/laravel-webhook-client
    |
    */
    'webhook' => [
        /**
         * Enable or disable the Cloudflare Stream webhook client.
         */
        'enabled' => env('CLOUDFLARE_STREAM_WEBHOOK_ENABLED', true),

        /**
         * Spatie Laravel Webhook Client supports multiple webhook receiving endpoints.
         */
        'name' => 'cloudflare-stream',

        /**
         * The URL used to receive Cloudflare Stream webhooks.
         */
        'url' => 'webhooks/cloudflare-stream',

        /**
         * The middleware to be applied to the webhook route.
         */
        'middleware' => [],

        /**
         * The secret used to sign the webhook requests.
         *
         * @see https://developers.cloudflare.com/stream/manage-video-library/using-webhooks/#verify-webhook-authenticity
         */
        'signing_secret' => env('CLOUDFLARE_STREAM_WEBHOOK_SIGNING_SECRET', ''),

        /**
         * The name of the header containing the signature.
         */
        'signature_header_name' => env('CLOUDFLARE_STREAM_WEBHOOK_SIGNATURE_HEADER_NAME', 'Webhook-Signature'),

        /**
         *  This class will verify that the content of the signature header is valid.
         *
         * It should implement \Spatie\WebhookClient\SignatureValidator\SignatureValidator
         */
        'signature_validator' => \Szhorvath\LaravelCloudflareStream\Webhook\StreamSignatureValidator::class,

        /**
         * This class determines if the webhook call should be stored and processed.
         */
        'webhook_profile' => \Spatie\WebhookClient\WebhookProfile\ProcessEverythingWebhookProfile::class,

        /**
         * This class determines the response on a valid webhook call.
         */
        'webhook_response' => \Spatie\WebhookClient\WebhookResponse\DefaultRespondsTo::class,

        /**
         * The classname of the model to be used to store webhook calls. The class should
         * be equal or extend Spatie\WebhookClient\Models\WebhookCall.
         */
        'webhook_model' => \Spatie\WebhookClient\Models\WebhookCall::class,

        /**
         * In this array, you can pass the headers that should be stored on
         * the webhook call model when a webhook comes in.
         *
         * To store all headers, set this value to `*`.
         */
        'store_headers' => '*',

        /**
         * The class name of the job that will process the webhook request.
         *
         * This should be set to a class that extends \Spatie\WebhookClient\Jobs\ProcessWebhookJob.
         */
        'process_webhook_job' => \Szhorvath\LaravelCloudflareStream\Jobs\ProcessCloudflareStreamJob::class,
    ],
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="cloudflare-stream-views"
```

Usage
-----

[](#usage)

```
use Szhorvath\LaravelCloudflareStream\Facades\CloudflareStream;

CloudflareStream::signer()->tokenFor('videoUid');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Sandor Horvath](https://github.com/szhorvath)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance59

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae4a7b4fd77cb0605312cecc6065730c0673f81cdbf3f005e0c17e56afc0ad3a?d=identicon)[szhorvath](/maintainers/szhorvath)

---

Top Contributors

[![sandorvivedia](https://avatars.githubusercontent.com/u/144906858?v=4)](https://github.com/sandorvivedia "sandorvivedia (24 commits)")[![szhorvath](https://avatars.githubusercontent.com/u/38496732?v=4)](https://github.com/szhorvath "szhorvath (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

### Embed Badge

![Health badge](/badges/szhorvath-laravel-cloudflare-stream/health.svg)

```
[![Health](https://phpackages.com/badges/szhorvath-laravel-cloudflare-stream/health.svg)](https://phpackages.com/packages/szhorvath-laravel-cloudflare-stream)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
