web.php 1.12 KB
<?php

use App\Http\Controllers\OcrController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', [OcrController::class,'index']);
Route::get('/test', function () {
    $file = 'D:\\key\\id_rsa_oms_base_test.pem';

    return response()->json([
        'php_sapi'         => PHP_SAPI,
        'current_user'     => get_current_user(),
        'script_owner'     => getmyuid(),
        'cwd'              => getcwd(),
        'file_exists'      => file_exists($file),
        'is_readable'      => is_readable($file),
        'realpath'         => realpath($file),
        'file_get_contents'=> @file_get_contents($file) !== false ? 'OK' : error_get_last(),
    ]);
});

Route::post('/import-pdf', [OcrController::class,'import_pdf'])->name('import_pdf');