0

Suddenly i'm facing

Class 'Illuminate\Foundation\Application' not found"

in my project. Is there any solution or edit require?

I have already updated my composer using this:

composer update --no-scripts

Here is my bootstrap\app.php code:

<?php
$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
$app->singleton(
    Illuminate\Contracts\Http\Kernel::class,
    App\Http\Kernel::class
);
$app->singleton(
    Illuminate\Contracts\Console\Kernel::class,
    App\Console\Kernel::class
);
$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);
return $app; 
Nik
  • 2,885
  • 2
  • 25
  • 25
  • 1
    Have you tried a `composer dump-autoload` ? – Crawdingle Mar 29 '19 at 13:40
  • 1
    You may start by showing us some code.. Where your class is loaded? Your composer.json etc... Your question is too vague to be answered at this state – olibiaz Mar 29 '19 at 13:40
  • Check that Illuminate is in your composer.json file – Lulceltech Mar 29 '19 at 13:40
  • @TanvirAhmedChowdhury: add the code in your question by updating it. Thank to code formatting, it would make it easier to read it. – Al-un Mar 29 '19 at 13:47
  • I just tried composer dump-autoload it shows me : C:\Users\ASUS\Desktop\blog>composer dump-autoload Generating optimized autoload files> Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi Discovered Package: beyondcode/laravel-dump-server Discovered Package: fideloper/proxy Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 3525 classes – Tanvir Ahmed Chowdhury Mar 29 '19 at 14:00
  • Do you load the autoload somewhere? `require_once __DIR__.'/your_path/vendor/autoload.php';` – olibiaz Mar 29 '19 at 14:17
  • Try https://stackoverflow.com/questions/29764368/fatal-error-class-illuminate-foundation-application-not-found , https://stackoverflow.com/questions/48199082/class-illuminate-foundation-application-not-found-laravel – aynber Mar 29 '19 at 14:18
  • My composer.json file is HERE : https://ideone.com/BDku1e @olibiaz – Tanvir Ahmed Chowdhury Mar 29 '19 at 15:27
  • yes i load the autoload.php in vendor\autoload.php . @olibiaz – Tanvir Ahmed Chowdhury Mar 29 '19 at 16:04
  • 1
    Thank you all. I didn't notice that i commented require __DIR__.'/../vendor/autoload.php'; In the public\index.php .Now i removed that comment and it is worked out. – Tanvir Ahmed Chowdhury Mar 29 '19 at 18:48

0 Answers0