Orchestra Testbench is focused on automated tests. With Workbench, you also get a small Laravel app inside your package repository for interactive development.Use it as a continuation of package-testing when you need UI checks, route verification, and seeded integration scenarios.
Use testbench.yaml in the package root to control providers, migrations, and build steps.
testbench.yaml often contains environment-specific settings. Add it to .gitignore and keep a testbench.yaml.example template in the repository for other developers.
Use workbench/database/migrations and workbench/database/seeders to test your package against realistic schema and data.
use Illuminate\Database\Schema\Blueprint;use Illuminate\Support\Facades\Schema;Schema::create('widgets', function (Blueprint $table) { $table->id(); $table->string('name'); $table->timestamps();});
Populate test data with a seeder:
<?phpnamespace Workbench\Database\Seeders;use Illuminate\Database\Seeder;use Workbench\Database\Factories\UserFactory;class DatabaseSeeder extends Seeder{ public function run(): void { UserFactory::new()->count(10)->create(); }}
# Clear and do a full rebuildcomposer clear && composer prepare && composer build# Check package discoveryvendor/bin/testbench package:discover --ansi# Inspect configurationvendor/bin/testbench about# List all routesvendor/bin/testbench route:list
Workbench fails to build
Check testbench.yaml syntax and provider configuration. YAML indentation errors are a common cause.
Routes are not loading
Verify the route file paths and the WorkbenchServiceProvider registration. Confirm that discovers.web is set to true in testbench.yaml.
Database errors
Check that migration paths are correct. When using SQLite, make sure the create-sqlite-db build step is included.