Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

teampoison's avatar

Laravel 5.5 ( Class 'App\Http\Controllers\ImportWord' not found )

Code : if ($request->has('upload')) { $profilesUpload=[]; $fileStatuses = []; foreach ($request->profile_files as $file) { $data = $request->except($exceptCols); foreach($data as $key=>$value) { if(is_null($value) || $value == '') unset($data[$key]); } $dataAr = ImportWord::import((String) $file);

File : namespace App\Http\Controllers;

use Illuminate\Http\Request; use Illuminate\Validation\Rule; use Illuminate\Support\Facades\Gate; use App\Http\Controllers\ImportWord; use App\Models\Profile; use App\Models\ProfileExtra; use App\Models\User; use App\Models\Notification; use Auth, Carbon\Carbon; use App\Models\ProfileImage; use App\Models\Match; use Intervention\Image\ImageManager;

0 likes
27 replies
PovilasKorop's avatar

You have this: use App\Http\Controllers\ImportWord;

Is that ImportWord really in Controllers? I don't think so.

teampoison's avatar

@Sinnbeck

if ($request->has('upload')) { $profilesUpload=[]; $fileStatuses = []; foreach ($request->profile_files as $file) { $data = $request->except($exceptCols); foreach($data as $key=>$value) { if(is_null($value) || $value == '') unset($data[$key]); } $dataAr = ImportWord::import((String) $file);

            if (!$dataAr) {
                $fileStatuses['errors'][] = $file->getClientOriginalName();
                \Log::error('Profile File Upload Error : ' . $file->getClientOriginalName());
            }
Sinnbeck's avatar

But it seems your files does not follow psr 4 autoloading so it might not work. I suggest watching the beginner tutorial on php on this site

teampoison's avatar

@Sinnbeck no i did not change anything from code. But beofre 1-2 month code will work fine. i just download i from server and run

Sinnbeck's avatar

@teampoison if you didn't change anything, can't you just download it again? It the code publicly available?

teampoison's avatar

@Sinnbeck when i do composer dump autoload i see this error in cmd

Class App\Http\Helpers\ImportWord located in C:/xampp/htdocs/app\Helpers\ImportWord.php does not comply with psr-4 autoloading standard. Skipping. Class App\Http\Helpers\ImportWord located in C:/xampp/htdocs/app\Http\Controllers\ImportWord.php does not comply with psr-4 autoloading standard. Skipping.

main issue is also in importword

Sinnbeck's avatar

@teampoison yes that is what I have been saying

But it seems your files does not follow psr 4 autoloading so it might not work

teampoison's avatar

i fix it but again same error class not found

Please or to participate in this conversation.