title: Laravel 5 custom package class not found
body: <p>I am creating laravel 5.2 package, following are my files</p>
  
  <p>packages/<br>
  -Shreeji/<br>
  --Ring/<br>
  ---composer.json<br>
  ---src/<br>
  ----Ring.php<br>
  ----RingModel.php<br>
  ----RingServiceProvider</p>
  
  <p>composer.json</p>
  
  <pre><code>{
   "name": "shreeji/ring",
   "description": "Simple",
   "license": "MIT",
   "authors": [
       {
           "name": "author",
           "email": "email@gmail.com"
       }
   ],
   "autoload": {
          "psr-4": {
               "Shreeji\\Ring\\": "src/"
           }
       },
   "minimum-stability": "dev",
   "require": {
       "Illuminate/support": "~5"
   }
  }
  </code></pre>
  
  <p>Ring.php</p>
  
  <pre><code>namespace Shreeji\Ring;
  
  use Illuminate\Http\Response;
  
  Class Ring {
  
  private $ringmodel;
  protected $table_name = null;
  
  
  function __construct() {
  
  }
  
  function set_table($table_name)
  {
      $this-&gt;table_name = $table_name;
      $this-&gt;ringmodel = New RingModel($this-&gt;table_name);
      return $this;
  }
  
  }
  </code></pre>
  
  <p>RingModel.php</p>
  
  <pre><code>use \Illuminate\Database\Eloquent\Model as Eloquent;
  
  class RingModel extends Eloquent {
  
  // Set table name;
  protected $table;
  protected $primary_key;
  
  public function __construct($table)
  {
      $this-&gt;table = $table;
  }
  }
  </code></pre>
  
  <p>RingServiceProvider.php</p>
  
  <pre><code>namespace Shreeji\Ring;
  
  use Illuminate\Support\ServiceProvider;
  
  Class RingServiceProvider extends ServiceProvider
  {
  public function register()
  {
      $this-&gt;app-&gt;bind('ring', function($app){
          return new Ring;
      });
  }
  
  public function boot()
  {
  
  }
  }
  </code></pre>
  
  <p>And in app/Http/Controllers I have created test file like this</p>
  
  <p>RingController.php</p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use App\Http\Controllers\Controller;
  use Shreeji\Ring;
  
  class RingController extends Controller
  {
  
   public function index()
   {
       $ring = New Ring();
       $ring-&gt;set_table('ring');
   }
  }
  </code></pre>
  
  <p>In Routes.php</p>
  
  <pre><code>Route::get('ringtest', [ 'as' =&gt; 'ringtest', 'uses' =&gt; 'RingController@index' ]);
  </code></pre>
  
  <p>I have added service provider in config/app.php as</p>
  
  <pre><code>Shreeji\Ring\RingServiceProvider::class,
  </code></pre>
  
  <p>In composer.json I have added this as</p>
  
  <pre><code>.....
  "psr-4": {
          "App\\": "app/",
          "Shreeji\\Ring\\": "packages/Shreeji/Ring/src"
      }
  .....
  </code></pre>
  
  <p>When I call ringtest from browser I get following error.</p>
  
  <p>FatalErrorException in RingController.php line 19: Class 'Shreeji\Ring' not found</p>
  
  <p>What is wrong with my code why this class is not found I have also run composer dumpautoload.</p>