2

Undefined type 'Yajra\Oci8\PDO' in laravel 10.17.1 with latest Yajra composer

   "message": "Class \"Yajra\\Oci8\\PDO\" not found",
   "exception": "Error",
   "file": "C:\\xampp\\htdocs\\bid_purchase_system_laravel\\app\\Http\\Controllers\\OtherController.php",
   "line": 38,

Screenshot of code

import line

use Yajra\Oci8\PDO;

enter image description here

oci8 also enables PHP Version 8.1.17.

enter image description here

Github

MT0
  • 143,790
  • 11
  • 59
  • 117
Nalawala Murtuza
  • 4,605
  • 1
  • 12
  • 21
  • I may be mistaken, but it appears as if you're trying to use PDO directly, or rather this library directly based on a false understanding of the classes it is composed of. The documentation for that library does not suggest the existence of that class or that line you used to import it from what I can find. Can you please clarify? – Daedalus Aug 06 '23 at 10:15
  • yes, after Use PDO, I can access constant, but the procedure returns a null out value. – Nalawala Murtuza Aug 06 '23 at 12:17
  • As far as I know PDO is built in class of PHP . Is this your code or this is belongs to Yajra https://i.stack.imgur.com/CKJkj.png ? – Ariful Islam Aug 06 '23 at 12:43
  • yes image code is mine – Nalawala Murtuza Aug 06 '23 at 12:52
  • Can you add extra backslash ( \ ) at the beginning of PDO:: and try again ? \PDO::PARAM_STR – Ariful Islam Aug 06 '23 at 13:20
  • Why are you using PDO directly instead of Laravel's DB facade? – Daedalus Aug 06 '23 at 20:31

1 Answers1

0

Use below import

 use POD

instead of

use Yajra\Oci8\PDO;
Nalawala Murtuza
  • 4,605
  • 1
  • 12
  • 21