Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Scenario Laravel Package

juststeveking/scenario

Scenario is a lightweight Laravel package for defining named scenarios and running them on demand, keeping repetitive setup logic in one expressive, reusable place instead of scattering it across seeders, tests, and Artisan commands.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require juststeveking/scenario; pin the exact 0.0.3 version while the package is pre-1.0.
  • Look first at the README, src/, and the new tests/ added in 0.0.3. The release is primarily a testing/quality release, so confirm the public API from source rather than assuming new user-facing features.
  • First use case: define one small scenario representing an application state or workflow you currently duplicate across feature tests, then invoke it from a single test before rolling it out.
  • Run the package’s own tests and your app’s test suite immediately after install to confirm Laravel/PHP compatibility.

Implementation Patterns

  • Use scenarios as reusable “arrange” steps in feature tests; keep assertions in the test itself so failures remain obvious.
  • Name scenarios by user intent, e.g. CustomerWithActiveSubscription, rather than by implementation detail.
  • Compose small scenarios instead of building deep inheritance hierarchies; prefer explicit steps that are easy to read and debug.
  • Use factories, seeders, and container bindings inside scenarios. Avoid real HTTP calls in setup unless the scenario is explicitly end-to-end.
  • Integrate through PHPUnit/Pest helpers or traits if the package exposes them; otherwise wrap scenario invocation in a small app-level test helper.
  • In CI, run scenarios in the same database/transaction strategy as the rest of your test suite. Treat 0.0.3 as an internal quality improvement, not a new public API surface.

Gotchas and Tips

  • 0.0.x APIs are unstable. Pin 0.0.3, review changelogs before upgrading, and expect possible breaking changes in future releases.
  • The 0.0.3 release note only mentions “Feature/testing”; do not assume new user-facing behavior. Check tests/ and src/ for actual changes.
  • Keep scenarios idempotent and isolated. Use RefreshDatabase/transactions consistently, and avoid hidden global state.
  • Do not bury assertions inside scenarios; debugging becomes harder when setup and verification are mixed.
  • If config publishing or service-provider auto-discovery is present, run php artisan config:clear after changes and verify discovery in the target Laravel version.
  • Debug by running a single test/scenario, inspecting scenario steps, and checking the package’s new tests for intended usage patterns.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle