title: Abstract class saying it is not found
body: <p>I am trying to use an abstract class for the following and I am getting an error saying:</p>
  
  <blockquote>
    <p>Class 'Acme\Transformers\LessonTransformer' does not exist.</p>
  </blockquote>
  
  <p>I also Added the controller class in case there may be something wrong with that. Can anyone let me know what I am overlooking here? </p>
  
  <h2>LessonTransformer</h2>
  
  <pre><code>&lt;?php
  
  namespace Acme\Transformers;
  
  class LessonTransformer extends Transformer {
  
      public function transform($lesson){
  
          return [
  
              'title'=&gt; $lesson['title'],
  
              'body' =&gt; $lesson['body'],
  
              'active' =&gt; (boolean) $lesson['some_bool']
  
          ];
      }
  }
  </code></pre>
  
  <h2>Transformer</h2>
  
  <pre><code>&lt;?php
  
  namespace Acme\Transformers;
  
  abstract class Transformer{
  
      public function transformCollection($items){
  
          return array_map([$this, 'transform'], $items);
  
      }
  
      abstract public function transform($item);
  }
  </code></pre>
  
  <h2>LessonsController</h2>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Acme\Transformers\LessonTransformer;
  use App\Lesson as Lesson;
  
  class LessonsController extends Controller
  {
  
      protected $lessonTransformer;
  
      function __construct(LessonTransformer $lessonTransformer){
  
          $this-&gt;lessonTransformer = $lessonTransformer;
  
      }
  
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          // 1. All is bad
          // 2. No way to attach meta data
          // 3. Linking the Db structure to api output
          // 4. No way to signal headers or response codes
          // return Lesson::all();
  
          $lessons = Lesson::all();
          return response()-&gt;json([
              'data' =&gt; $this-&gt;lessonTransformer-&gt;transformCollection($lessons-&gt;all())
          ], 200);
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          //
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
          //
      }
  
      /**
       * Display the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          $lesson = Lesson::find($id);
  
          if(!$lesson){
              return response()-&gt;json([
  
              'error' =&gt; [
                  'message' =&gt; 'lesson does not exist'
              ]
  
              ], 404);
          }
  
          return response()-&gt;json([
  
              'data' =&gt; $this-&gt;lessonTransformer-&gt;transform($lesson)
  
          ],200);
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          //
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, $id)
      {
          //
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          //
      }
  
  }
  </code></pre>
  
  <h2>composer.json</h2>
  
  <pre><code>{
      "name": "laravel/laravel",
      "description": "The Laravel Framework.",
      "keywords": ["framework", "laravel"],
      "license": "MIT",
      "type": "project",
      "require": {
          "php": "^7.1.3",
          "fideloper/proxy": "^4.0",
          "fzaninotto/faker": "^1.7",
          "laravel/framework": "5.6.*",
          "laravel/tinker": "^1.0"
      },
      "require-dev": {
          "filp/whoops": "^2.0",
          "mockery/mockery": "^1.0",
          "nunomaduro/collision": "^2.0",
          "phpunit/phpunit": "^7.0"
      },
      "autoload": {
          "classmap": [
              "database/seeds",
              "database/factories",
              "app/acme"
          ],
          "psr-4": {
              "App\\": "app/"
          }
      },
      "autoload-dev": {
          "psr-4": {
              "Tests\\": "tests/"
          }
      },
      "extra": {
          "laravel": {
              "dont-discover": [
              ]
          }
      },
      "scripts": {
          "post-root-package-install": [
              "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
          ],
          "post-create-project-cmd": [
              "@php artisan key:generate"
          ],
          "post-autoload-dump": [
              "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
              "@php artisan package:discover"
          ]
      },
      "config": {
          "preferred-install": "dist",
          "sort-packages": true,
          "optimize-autoloader": true
      },
      "minimum-stability": "dev",
      "prefer-stable": true
  }
  </code></pre>