title: Laravel middleware redirects all auth routes in packages to dashboard
body: <p>I'm setting up a laravel 5.3 application that uses custom packages and laravel authentication middleware. When I define routes in the laravel/packages/vendor/packageName/src/routes.php as is the case in </p>
  
  <pre><code>Route::get('member/list', function() {
      return 'member lists here';
  })-&gt;middleware('auth');
  </code></pre>
  
  <p>it redirects to localhost:8000/dashboard url defined in the RedirectIfAuthenticated Middleware but when I define the route in resources/routes/web.php, it routes and authorizes as required.</p>
  
  <p>Is there anything i am doing wrong, or something I need to check? </p>
  
  <p>---Update---
  Below is a snippet from my ServiceProvider class</p>
  
  <pre><code>namespace Beansoft\PractitionerIMS;
  use Illuminate\Support\ServiceProvider;
  class PractitionerIMSServiceProvider extends ServiceProvider {
      public function register() {
          $this-&gt;app-&gt;bind('practitionerims', function($app) {
              return new PractitionerIMS;
          });
      }
  
      public function boot() {
          //load the routes file
          if (!$this-&gt;app-&gt;routesAreCached()) {
              require __DIR__ . '/Http/routes.php';
          }
  }
  </code></pre>
  
  <p>App/Config/app.php</p>
  
  <pre><code>'providers' =&gt; [
  
          /*
           * Laravel Framework Service Providers...
           */
          Illuminate\Auth\AuthServiceProvider::class,
          Illuminate\Broadcasting\BroadcastServiceProvider::class,
          Illuminate\Bus\BusServiceProvider::class,
          Illuminate\Cache\CacheServiceProvider::class,
          Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
          Illuminate\Cookie\CookieServiceProvider::class,
          Illuminate\Database\DatabaseServiceProvider::class,
          Illuminate\Encryption\EncryptionServiceProvider::class,
          Illuminate\Filesystem\FilesystemServiceProvider::class,
          Illuminate\Foundation\Providers\FoundationServiceProvider::class,
          Illuminate\Hashing\HashServiceProvider::class,
          Illuminate\Mail\MailServiceProvider::class,
          Illuminate\Notifications\NotificationServiceProvider::class,
          Illuminate\Pagination\PaginationServiceProvider::class,
          Illuminate\Pipeline\PipelineServiceProvider::class,
          Illuminate\Queue\QueueServiceProvider::class,
          Illuminate\Redis\RedisServiceProvider::class,
          Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
          Illuminate\Session\SessionServiceProvider::class,
          Illuminate\Translation\TranslationServiceProvider::class,
          Illuminate\Validation\ValidationServiceProvider::class,
          Illuminate\View\ViewServiceProvider::class,
  
          Beansoft\PractitionerIMS\PractitionerIMSServiceProvider::class,
  
  
          /*
           * Package Service Providers...
           */
  
          //
          Yab\Laracogs\LaracogsProvider::class,
  
          /*
           * Application Service Providers...
           */
          App\Providers\AppServiceProvider::class,
          App\Providers\AuthServiceProvider::class,
          // App\Providers\BroadcastServiceProvider::class,
          App\Providers\EventServiceProvider::class,
          App\Providers\RouteServiceProvider::class,
  
      ],
  </code></pre>
  
  <p>Output of php artisan route</p>
  
  <p><a href="https://i.stack.imgur.com/yMIQQ.png" rel="nofollow"><img src="https://i.stack.imgur.com/yMIQQ.png" alt="enter image description here"></a></p>