1. Go to this page and download the library: Download onepointhub/laravel_ocr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
onepointhub / laravel_ocr example snippets
use Ntoufoudis\LaravelOcr\Facades\Ocr;
Ocr::scan($imagePath);
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Ntoufoudis\LaravelOcr\Facades\Ocr;
class OcrController extends Controller
{
public function index()
{
return view('upload_image');
}
public function readImage()
{
$image = request('image');
if (isset($image) && $image->getPathName()) {
$parsedText = Ocr::scan($image->getPathName());
return view('parsed_image', compact('parsedText'));
}
}
}