Downloads
Stars
Version
Scraper requires PHP 7.1 or 7.2. This particular version supports Laravel 5.5 or 5.6 only.
To get the latest version, simply require the project using Composer:
Via Composer
$ composer require sturt/salary
Once installed, if you are not using automatic package discovery, then you need to register the sturt\salary\SalaryServiceProvider::class,
service provider in your config/app.php
.
Scraper supports optional configuration.
To get started, you'll need to publish all vendor assets:
$ php artisan vendor:publish
This will create a config/sa.php
file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
Open sa.php from Config
return [
// add more patterns if needed
'patterns' => [
'net pay',
'et pay',
'net payable',
'gross pay',
'total pay',
'net pay',
],
// Image file stored path
'FILE_PATH' => base_path() ."/public/uploads/",
//Change Route ULR
'ROUTE_NAME' => 'upload_salary_slip',
// Change Language - More language coming soon
'OCR_LANG' => 'eng',
];
get request to /upload_salary_slip/file.jpg located in public/uploads/
Success
{"status":200,"salary":"35,430.00"}
File not found
{"status":204,"file_not_found":"\/public\/file Not found"}
There are many ways to install Tesseract OCR on your system, but if you just want something quick to get up and running, I recommend installing the Capture2Text package with Chocolatey.
choco install capture2text --version 3.9
:warning: Recent versions of Capture2Text stopped shipping the tesseract
binary.
With MacPorts you can install support for individual languages, like so:
$ sudo port install tesseract-<langcode>
But that is not possible with Homebrew. It comes only with English support by default, so if you intend to use it for other language, the quickest solution is to install them all:
$ brew install tesseract --with-all-languages
tesseract-ocr-for-php is released under the MIT License.