Does the folder structure where CCheckMail resides also match the namespace? eg. App > ExternalClasses > CCheckMail?
Sep 20, 2018
8
Level 1
external classes and PHP files in Laravel - Class not found
I have two php files and I already created a folder called "ExternalClasses" and added the file to that folder. In my php file, I add this line namespace App\ExternalClasses;
and in my controller I add this line use App\ExternalClasses\CCheckMail;
and this is how I use it: $pricesClass = new CCheckMail(); $email2 = ['[email protected]']; $prices = $pricesClass->execute ($email2); return view('pages.home', compact('prices'));
but it gave me an error: Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\ExternalClasses\CCheckMail' not found
Here is my php file (CCheckMail.php):-
Please or to participate in this conversation.