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.
You can install the package via composer:
composer require webmavens/laravelscandocumentPublish migrate file.
php artisan vendor:publish --tag="laravelscandocument-migrations"php artisan migrateThis package includes a powerful command that will automatically create and configure all required AWS resources for you — including:
- S3 Bucket (for document storage)
- SNS Topic (for Textract notifications)
- IAM Role (for Textract permissions)
- IAM User (with access keys)
All credentials and ARNs will be automatically written into your .env file.
php artisan aws:setupYou’ll be asked for your AWS Admin Access Key, Secret Key, and Region.
Once the command completes, it will output details of the created AWS resources and save the following environment variables automatically:
AWS_ACCESS_KEY_ID=YOUR_NEW_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_NEW_SECRET_KEY
AWS_DEFAULT_REGION=YOUR_REGION
AWS_BUCKET=YOUR_BUCKET_NAME
AWS_SNS_TOPIC_ID=YOUR_SNS_TOPIC_ARN
AWS_ARN_TOPIC_ID=YOUR_TEXTRACT_ROLE_ARNWhen the command creates your SNS topic, it automatically subscribes your callback endpoint:
https://{YOUR_DOMAIN_NAME}/textractCallbackNote :- Please do not set up raw message delivery for callback url.
- Send document to scan
$laravelScandocument = new \Webmavens\LaravelScandocument\LaravelScandocument();
// $path = File path from s3 eg. uploads/test.jpg
// $jobtag = Type of document
$response = $laravelScandocument->sendDocToScan($path, $jobtag); //$jobtag is optional.It should be string.-
This will upload your document to AWS Textract and process it automatically and return JOBID in response.
-
You’ll receive the extracted data via your SNS callback endpoint (/textractCallback).
-
You will find scan document text in laravel_scandocument_data table.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.