title: Class 'app' not found in bootstrap\app.php:4 #1 {main} thrown in C:\Users\Logan\Cart\bootstrap\app.php on line 4
body: <p>I keep getting this error I checked the composer.json file and everything seems to be alright I'm following a tutorial for a shopping cart online in php. Any help would be greatly appreciated it.</p>
  
  <p>I checked a similar question and he corrected in the composer.json file and that's not the issue with my problem. </p>
  
  <p>bootstrap-app.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  session_start();
  $app = new app;
  
  require __DIR__ . '/../vendor/autoload.php';
  require __DIR__ . '/../app/routes.php';
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>&lt;?php
  
  require __DIR__ . '/../bootstrap/app.php';
  
  $app-&gt;run();
  </code></pre>
  
  <p>composer.json</p>
  
  <pre><code>"autoload": {
      "psr-4": {
          "Cart\\": "app/"
      }
  },
  </code></pre>
  
  <p>I've also have dumped the file before and no changes. I'm new to php and I'm just trying to complete this tutorial so I can complete an e-commerce website.</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Class 'app' not found in<br>
    C:\Users\Logan\Cart\bootstrap\app.php:4 Stack trace: #0   C:\Users\Logan\Cart\public\index.php(3): require() #1 {main} thrown in C:\Users\Logan\Cart\bootstrap\app.php on line 4</p>
  </blockquote>
  
  <p>Edited to include this:</p>
  
  <pre><code>&lt;?php
  
  namespace Cart;
  
  use DI\ContainerBuilder;
  use DI\Bridge\Slim\App as DIBridge;
  
  
  class App extends DIBridge
  {
      protected function configureContainer(ContainerBuilder $builder)
      {
          $builder-&gt;addDefintions (
              ['settings.displayErrorDetails' =&gt; true,] );
  
              $builder-&gt;addDefinitions(__DIR__ .'/container.php');
      }   
  
  }
  </code></pre>