For more control over the extraction process, you can create custom strategies tailored to your specific document types or complex extraction tasks.
Create a Custom Strategy
Strategy
interface.
Doing so by extending the Extractor
class is a good starting point for custom strategies as it contains some useful methods that you probably don’t want to implement yourself.Implement the Strategy
run()
method, which takes the artifacts as an array.The array
that the run method returns is used as the final output data.Register the Strategy
Magic::registerStrategy('my-custom-strategy', MyCustomStrategy::class)
in your boot()
method in the service provider.