## Getting Started
This package is in its **beta (v1.0.0-beta)** stage, meaning core functionality is now available but expect evolving APIs and potential breaking changes in future releases. To begin:
1. **Installation**: Add the package via Composer:
```bash
composer require vendor/package-name
Publish the package's configuration (if applicable) with:
php artisan vendor:publish --provider="Vendor\PackageName\PackageServiceProvider"
First Use Case: The package introduces a pipeline-based workflow for quality checks and unit testing. Start by defining a pipeline in your config/package-name.php (or equivalent) to chain validation steps:
'pipeline' => [
'validate_schema',
'run_unit_tests',
// Add custom steps later
],
Trigger the pipeline via a facade or service container:
use Vendor\PackageName\Facades\Pipeline;
$results = Pipeline::run();
Documentation: Check the package's README.md for manual validation steps and global testing workflows. Note that this is a work-in-progress (WIP)—prioritize testing in a staging environment.
Pipeline Integration:
Pipeline::addStep('custom_validation', function ($payload) {
// Your logic here
return $payload;
});
public function boot()
{
Pipeline::addStep('my_custom_check', function ($data) {
// ...
});
}
Testing Integration:
$testResults = Pipeline::run(['step' => 'run_unit_tests']);
Manual Validation:
php artisan package-name:validate
try-catch blocks to gracefully handle failures:
try {
Pipeline::run();
} catch (\Vendor\PackageName\Exceptions\ValidationFailed $e) {
// Log or notify
}
Beta Stage Risks:
Manual Validation Quirks:
package-name:validate) may require specific environment setups (e.g., database connections, API keys). Test thoroughly in a replica environment.Testing Gaps:
'debug' => env('APP_DEBUG', false),
Pipeline::run(['step' => 'validate_schema']);
ValidationFailed) for granular error handling.Custom Steps:
Vendor\PackageName\Contracts\PipelineStep interface:
class MyStep implements PipelineStep {
public function handle($payload) { ... }
}
Pipeline::addStep('my_step', new MyStep());
Configuration Overrides:
'pipeline' => [
'steps' => [
'validate_schema' => ['enabled' => env('ENABLE_SCHEMA_VALIDATION', true)],
],
],
Event Listeners:
PipelineStepExecuted) to react to step outcomes:
public function handle(PipelineStepExecuted $event) {
// Post-processing logic
}
NO_UPDATE_NEEDED would **not** apply here due to the significant new functionality introduced in the beta release.
How can I help you explore Laravel packages today?