A Laravel package for Cloudflare Stream.
bjthecod3r/laravel-cloudflare-stream is a Laravel package for a laravel package for cloudflare stream..
It currently has 20 GitHub stars and 3.480 downloads on Packagist (latest version v1.1.0).
Install it with composer require bjthecod3r/laravel-cloudflare-stream.
Discover more Laravel packages by bjthecod3r
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel Package for working with Cloudflare Stream seamlessly
Supports Laravel 10, 11, 12, and 13.
Run
composer require bjthecod3r/laravel-cloudflare-stream
You may publish the configuration file using this command:
php artisan vendor:publish --provider="Bjthecod3r\CloudflareStream\CloudflareStreamServiceProvider"
A configuration file named cloudflare-stream with some defaults and required properties will be placed in your config directory.
Open your .env file and add the following variables, remember to substitute the actual values
CLOUDFLARE_API_TOKEN=xxxxxxxxxxxx
CLOUDFLARE_ACCOUNT_ID=xxxxxxxxxxxxxxxxx
CLOUDFLARE_API_BASE_URL=https://api.cloudflare.com/client/v4/accounts
CLOUDFLARE_KEY_ID=xxxxxxxxxxxxxxx
Using the package is pretty straight forward, you can make use of the class like you would do any in Laravel. There is also support for facade.
use Bjthecod3r\CloudflareStream\CloudflareStream;
use Bjthecod3r\CloudflareStream\Facades\CloudflareStream as CloudflareStreamFacade;
class StreamService
{
public function fetchStream(string $id, CloudflareStream $cloudflareStream)
{
dd($cloudflareStream->fetchVideo($id));
}
public function fetchVideo(string $id): array
{
return CloudflareStreamFacade::fetchVideo($id);
}
}
This package currently covers my current usage of cloudflare stream, although, in the next couple of weeks I plan to expand its features. However, if there is a need for a particular feature, feel free to reach out to me via [email protected], and I'll gladly attend to it.
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
GitHub releases are managed with Google's release-please action.
fix:, feat:, or feat!: into main.release-please will open or update a Release PR with the next version and changelog changes.v* tag automatically.RELEASE_PLEASE_TOKEN secret with a PAT; otherwise the workflow falls back to GITHUB_TOKEN.Settings > Actions > General > Allow GitHub Actions to create and approve pull requests.The MIT License (MIT). Please see License File for more information.