FRAMEWORKS

Laravel video

Complete video infrastructure for a Laravel app. Install the package and you get uploads, adaptive playback, live streams, DRM, analytics and AI features, without building your own encoding, storage and delivery.

Free plan: 10 videos, 100K streaming minutes, 300 minutes of subtitles and moderation. No credit card.

PHP 8.2+ · Laravel 11+runtime
fastpix/sdkserver SDK
HTTP Basicauth

TRUSTED BY PRODUCT TEAMS SHIPPING VIDEO AT SCALE

Customer logoCustomer logoCustomer logoCustomer logoCustomer logoCustomer logo

What you get

What you get from FastPix for Laravel video

Four things you don't have to build or run yourself.

One video API

Upload, storage, delivery, the player, analytics and AI all come from the same API. No Vite plugin, nothing added to your build.

Built-in encoding

FastPix turns each upload into several quality levels and packages them for streaming. No FFmpeg, no queue workers.

Analytics already on

The player sends view data on its own. Add a title and a viewer ID and you can see who watched what.

Secure video streaming and DRM

Sign a token on your server and pass it to the player. Widevine, PlayReady and FairPlay are all supported.

Functionality

Every Laravel video capability, from upload to AI

Pick a group, then a capability. Each one tells you whether the code goes in a Laravel controller, a Blade view or an Inertia page.

Video upload API

A controller action creates the signed URL. The browser then uploads the file straight to FastPix in chunks, so the bytes never pass through PHP and post_max_size stops mattering. If the connection drops, the upload picks up where it left off.

Where it runs · Laravel controller creates, browser sends
1$upload = FastPixService::make()->inputVideo
2 ->directUploadVideoMedia(
3 new DirectUploadVideoMediaRequest(
4 corsOrigin: '*',
5 ),
6 );

Setup

Install and configure the Laravel video package

Install the Laravel video packages

The PHP SDK runs on your server, where it creates upload URLs, signs playback tokens and asks for AI features. The uploader and the player run in the browser.

composer + npm
1# Server: the PHP SDK talks to the FastPix API
2composer require fastpix/sdk
3
4# Browser: the uploader (React, via Inertia) and the player
5npm install @fastpix/fp-react-uploader @fastpix/fp-player
6
7# If Composer refuses on a locked Guzzle version
8composer require fastpix/sdk --with-all-dependencies
9
10// resources/js/app.js: the player needs no React
11import "@fastpix/fp-player";

Configure the Laravel video package

There's no API key. You get two values, an Access Token ID and a Secret Key, and they work as a username and password. Read them through config, not env(), so they survive config:cache.

Get your access token
config/fastpix.php
1// config/fastpix.php. env() outside config files
2// stops working once you run php artisan config:cache.
3return [
4 'username' => env('FASTPIX_USERNAME'), // Access Token ID
5 'password' => env('FASTPIX_PASSWORD'), // Secret Key
6];
7
8// app/Services/FastPixService.php
9return Fastpixsdk::builder()
10 ->setSecurity(new Security(
11 username: config('fastpix.username'),
12 password: config('fastpix.password'),
13 ))
14 ->build();

A Laravel project with all of it wired

The controller, the Inertia upload page, the webhook route and the CSRF exemption, in one project you can clone and run. Everything in one place instead of four doc pages.

· Laravel 11· Inertia· React
· Blade path· Resumable upload· HLS playback

Behind the scenes

What happens after your Laravel app uploads a file

Here's what happens between the file leaving the browser and the video reaching a viewer. None of it is code you write, and none of it runs in your app.

480p
1080p
Encoding renditions
4K

Native uploader

Chunked and resumable, from the browser to a signed URL.

Import from a URL

Or pass a public video URL and FastPix pulls it in.

FastPix

Ingest, encode, package

No FFmpeg, no build step, nothing in your output directory.

Chunked, resumable ingest
Transcode to a ladder
Store and version
Package HLS renditions
Thumbnails and captions
Encrypt for DRM

video.media.ready

The webhook that tells your server the video is ready.

Adaptive playback

One playback ID into the player, on-demand or live.

1
2
3

Upload

From your Laravel app

Process

FastPix handles this

Play

Webhook + playback ID

Your Laravel app only touches the two ends. A server call hands over a signed URL and the player takes the playback ID. In between, a video.media.ready webhook tells your server the video is ready.

FAQ

Laravel video questions, answered

  • What is the best way to stream video in Laravel?

    Not through a Laravel route, if you can avoid it. Serving video from PHP means either a byte-range StreamedResponse you maintain yourself or a controller that holds a worker open for the length of the view. Store the video outside your app, hand the browser a manifest URL, and let a CDN serve the segments. Laravel then does nothing during playback at all.

  • Do I need a byte-range StreamedResponse to serve video from Laravel?

    Only if the file is being served by Laravel. Byte-range support is what makes seeking work, and every hand-rolled Laravel video streamer exists to implement it. An adaptive stream removes the requirement, because the video is already split into segments and the player requests them individually over ordinary HTTP.

  • How do I upload a video in Laravel?

    Create a signed upload URL in a controller and let the browser send the file straight to storage. Your route returns JSON and finishes in milliseconds, so upload_max_filesize and post_max_size never come into it. The php.ini settings do not apply to a file that never reaches PHP.

  • How do I upload large video files past Laravel's limits?

    The limits apply to request bodies PHP parses, so route the file around them. With a direct upload the browser uploads to a signed URL in chunks and resumes after a dropped connection, and the only request Laravel handles is a few hundred bytes of JSON.