Support the ongoing development of Laravel.io →
Packages Configuration

Hi everyone!

I am creating a new package and save it on packagist at https://packagist.org/packages/thiagovictorino/iam

I can install thru composer with no errors, But my routes isn't working on browser. Let me explain better...

I have a route /iam that I created in the package

File: laravel-iam/routes/iam.php

Route::middleware('api')->get('/iam',function (){
   return 'iam route';
});

I added it into the service provider as you can see here

File: laravel-iam/src/IAMServiceProvider.php

public function boot() {


        $this->loadRoutesFrom(__DIR__ . '/../routes/iam.php');

        $this->publishes([__DIR__.'/../config/iam.php' => config_path('iam.php')], 'thiagovictorino-iam');

        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

I added this package at my project and when I run 'php antisan route:list' the result is

enter image description here

The route exists, but when I try to access this route on browser, it is returning 404

Am I forgetting something?

the code is available at: https://github.com/thiagovictorino/iam

Last updated 3 years ago.
0

If it uses the api middleware, then you need to be navigating to /api/iam.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.