DEV Community

Discussion on: How To Create A Highly Configurable Laravel Package

Collapse
mahbod profile image
Mahbod Ahmadi

I did what you said but i get a 404 error in the routing section.
I don't have any idea why it shows me 404 😐

Collapse
devingray profile image
Devin Gray Author

Hi. Did you follow this step?

<?php

namespace DevinGray\CustomAuth\Providers;

use Illuminate\Support\ServiceProvider;

class CustomAuthServiceProvider extends ServiceProvider
{
    public function boot()
    {
        $this->loadRoutesFrom(__DIR__.'/../../routes/custom-auth.php');
    }
}
Enter fullscreen mode Exit fullscreen mode

The following code tells Laravel Where to load the package routes from

$this->loadRoutesFrom(__DIR__.'/../../routes/custom-auth.php');
Enter fullscreen mode Exit fullscreen mode

You must make sure that this loads the routes from the right path

Collapse
mahbod profile image
Mahbod Ahmadi

Yeah, the path was wrong 🤝