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
Route::get('member/list', function() {
return 'member lists here';
})->middleware('auth');
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.
Is there anything i am doing wrong, or something I need to check?
---Update--- Below is a snippet from my ServiceProvider class
namespace Beansoft\PractitionerIMS;
use Illuminate\Support\ServiceProvider;
class PractitionerIMSServiceProvider extends ServiceProvider {
public function register() {
$this->app->bind('practitionerims', function($app) {
return new PractitionerIMS;
});
}
public function boot() {
//load the routes file
if (!$this->app->routesAreCached()) {
require __DIR__ . '/Http/routes.php';
}
}
App/Config/app.php
'providers' => [
/*
* 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,
],
Output of php artisan route