Repository navigation
Sample Data
Your local database may be empty, or hold real people's data. By default, videos are recorded against a database made for them instead, so they show realistic data and never your own.
-
A base database, built once. Your migrations run on a separate SQLite file, then your seeders (
sample_data.seeders,DatabaseSeederby default), then a user of each type is found or made: the same types Record as offers. Users are made with yourUserFactorywhen you have one, and given their role the way your app records it (spatie, Laratrust, Bouncer, a role column or an admin flag).php artisan video-demo:installbuilds it, or build it any time:php artisan video-demo:sample-database # --fresh to build it againIt is built again by itself when the contents of a migration, seeder or factory change. Updating the package doesn't rebuild it unless the package's own migrations changed.
-
A copy for each video. Copying takes well under a second. The video's records go into its copy, which is deleted afterwards.
-
The AI adds what the flow needs. While planning, it also gets:
- every route's middleware, such as
auth,verifiedorpermission:view reports - the files of your own middleware, including middleware every page runs, such as a "finish your profile" check
- your policies and gates
It reads what decides access to each page in the flow and works out what the user needs: a role, a permission, a verified email, a profile photo, an active subscription. It also works out which records must exist and belong to them. It can look at what is there, then add records (with your factories) or update existing ones, such as the user's own row.
- every route's middleware, such as
-
It checks, and fixes. Pages that still fail before recording, and errors from your app while recording, go back to the AI with the reason, within the repair limit.
-
Recording again (free) rebuilds the same records, so the plan's pages find them.
Interstack's People page is only open to members with a profile photo. Its middleware returns 403 Add your photo to meet people here. On sample data the AI read EnsureProfileComplete and ProfileGate, set an avatar on the sample member, and the page opened. On a support-ticket flow in another app, it read SupportTicketPolicy and created three tickets belonging to the member, because the policy only shows a member their own tickets.
Only the recorder's browser. It sends a cookie the package signs with your app key. A request carrying it switches every database connection to the video's copy before anything else runs, so sessions, the signed-in user and every query use it. While it does:
- the cache is in memory
- queued jobs run straight away
- mail and broadcasts don't go out
Everyone else's requests, and your own database, are untouched. It only works while the studio is enabled.
| For | Do this |
|---|---|
| One video | Untick Record on sample data, or --own-data on the command line, or 'sample_data' => false from code |
| The whole app | VIDEO_DEMO_SAMPLE_DATA=false |
| A video made on your own data | Try again on sample data, or tick the box under Make it again |
-
Migrations that only run on MySQL or Postgres. Sample data uses SQLite. Most migrations are portable; one that isn't stops the build with its error. Guard it:
if (DB::getDriverName() === 'mysql') { ... }. - Outside services. Calls your app makes to other services, such as Stripe or an AI API, still go out. Use their test keys locally.
-
Uploaded files are not copied. The AI points image columns at files your app already has under
public/. -
Octane. The database is chosen when a request starts the app, which Octane does once per worker. Serve the app with Herd, Valet,
php artisan serveor PHP-FPM while recording. -
Rules that live outside your code, such as a feature flag in a remote service. Say what the user needs in the video's description, or in
ai.notes.
| Setting | Default | What it does |
|---|---|---|
sample_data.default (VIDEO_DEMO_SAMPLE_DATA) |
true |
Whether new videos record on sample data |
sample_data.seeders |
['Database\Seeders\DatabaseSeeder'] |
The seeders to run. Empty leaves it all to the AI. Missing seeders are skipped; one that fails is reported and the rest of the data kept. |
sample_data.timeout |
900 |
Seconds allowed for building the base database |
sample_data.artisan |
your app's artisan
|
The artisan file that builds it, in its own PHP process |
Getting started
Making videos
- The Studio
- Sample Data
- Styles and Screens
- Voice-over and Music
- Command Line
- Keeping Videos Up To Date
- Other Languages
- Separate Frontend
Showing videos
Going further
Help