webmavens / laravelscandocument
This will send to textract for scanning image.
Requires
- php: ^8.0
- aws/aws-php-sns-message-validator: ^1.6
- aws/aws-sdk-php: ^3.209
- spatie/laravel-package-tools: ^1.12
Requires (Dev)
- nunomaduro/collision: ^5.10
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
This package allows you to scan document with laravel.Amazon Simple Notification Service (Amazon SNS) is used for scan document. It is using offical AWS SDK for PHP and Amazon SNS Message Validator for PHP.
Installation
You can install the package via composer:
composer require webmavens/laravelscandocument
Usage
-
Please create SNS topic in your amazon account.
-
How to create one ?
-
Please create IAM Role for textract. Follow this link.
-
Please create SNS topic by searching SNS in your aws account.
-
After creating topic, please add subscribe url to SNS topic below.
Note :- Please do not set up raw message delivery for callback url.
https://{YOUR_DOMAIN_NAME}/textractCallback
- Please add below parameters to your .env file.
AWS_DEFAULT_REGION = 'YOUR_AWS_DEFAULT_REGION', AWS_ACCESS_KEY_ID = 'YOUR_AWS_ACCESS_KEY_ID', AWS_SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET_ACCESS_KEY', AWS_BUCKET = 'YOUR_AWS_BUCKET', AWS_ARN_TOPIC_ID = 'YOUR_AWS_ARN_TOPIC_ID', AWS_SNS_TOPIC_ID = 'YOUR_AWS_SNS_TOPIC_ID',
- Please publish migrate file.
php artisan vendor:publish --tag="laravelscandocument-migrations"
- Send document to scan
$laravelScandocument = new Webmavens\LaravelScandocument(); // $path = File path // $jobtag = Type of document $response = $laravelScandocument->sendDocToScan($path,$jobtag); //$jobtag is optional.It should be string.
- You will find scan document text in laravel_scandocument_data table.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.