Skip to content

Configuration

The Packages Toolkit for Laravel uses testbench.yaml as a configuration file where you can define the following schemas to be used within testbench CLI or Workbench environment:

NameTypeDescription
laravelstringSet the path to Laravel skeleton.
providersarrayList of Service Provider classes to be loaded.
migrationsarrayList of migrations path.
seedersarrayList of seeder classes to execute during migrate:fresh or migrate:refresh.
dont-discoverarrayList of packages to be ignored.
bootstrappersarraySet of bootstrapper classes to be loaded.
envarraySet environment variables to be loaded under testbench CLI.
purgearrayConfigurable files and directories to be pruned via package:purge-skeleton command.
workbenchObjectSee Workbench configuration for detail.

Basic Usages

In order for the testbench command to understand any required service providers, bootstrappers, environment variables or other options to be used when executing the "artisan" command you need to add the following testbench.yaml file on the project root directory.

yaml
providers:
  - Laravel\Passport\PassportServiceProvider

dont-discover: 
  - laravel/sanctum

Laravel Skeleton

You can use laravel configuration key to set a custom location instead of using the default vendor/orchestra/testbench-core/laravel:

yaml
laravel: ./skeleton

Service Providers

You can use providers configuration key to set an array of service providers to be loaded:

yaml
providers:
  - Laravel\Sanctum\SanctumServiceProvider
  - Workbench\App\Providers\WorkbenchServiceProvider

Exclude Packages

Alternatively, you can also use dont-discover to exclude specific packages from being loaded:

yaml
dont-discover:
  - laravel/html

Environment Variables

You can use env configuration key to set an array of environment variables to be loaded under testbench CLI:

yaml
env:
  - SEND_QUERIES_TO_RAY=(false)

env limitation

The env environment variables is only applied when using the CLI and will not be used when running tests.

Workbench Configuration

You can use workbench configuration key to set to enable Workbench integration on your Laravel packages.

NameTypeDescription
welcomeboolShow the default Laravel welcome page when accessing / via serve command.
installboolRun Laravel default migrations.
startstringSet the default route when opening / path via serve command.
userstring|intSet the user ID or email to automatically logged-in when accessing / via serve command (only when accessing as a guest).
guardstringSet the default Auth Guard to automatically authenticate user value.
syncarraySet a collection to create symlink between from and to value via serve command.
buildarraySet a collection of build recipes or command to be execute when running workbench:build command.
assetsarraySet a collection of tag used in vendor:publish to be use with asset-publish recipe when running workbench:build command.
discoversarraySupport setting boolean to enable web route, api route, commands route and views route.

Example

yaml
workbench:
  welcome: true
  install: true
  start: /nova
  user: taylor@laravel.com
  guard: web
  sync:
    - from: ./public/
      to: public/vendor/nova
  build:
    - asset-publish
    - create-sqlite-db
    - migrate:refresh
  assets:
    - nova-assets
  discovers:
    web: true
    api: false
    commands: false
    views: true