Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the routes, views and translations and set it as an option in the setup, or make a vendor publishing #42

Open
phackwer opened this issue Mar 31, 2021 · 5 comments

Comments

@phackwer
Copy link

Because the Service Provider defines this:

// $this->loadRoutesFrom(DIR.'/routes.php');
// $this->loadViewsFrom(DIR.'/Resources/views', 'black-bits/laravel-cognito-auth');
// $this->loadTranslationsFrom(DIR.'/Resources/lang', 'black-bits/laravel-cognito-auth');

I had no longer could run php artisan route:list without having a fatal error:

root@3adc9221d37d:/var/www/html# php artisan route:list

Illuminate\Contracts\Container\BindingResolutionException : Target class [App\Http\Controllers\Auth\VerificationController] does not exist.

at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:805
801|
802| try {
803| $reflector = new ReflectionClass($concrete);
804| } catch (ReflectionException $e) {

805| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
806| }
807|
808| // If the type is not instantiable, the developer is attempting to resolve
809| // an abstract type such as an Interface or Abstract Class and there is

Exception trace:

1 Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console{closure}()
[internal]:0

2 ReflectionException::("Class App\Http\Controllers\Auth\VerificationController does not exist")

@bartmcleod
Copy link

bartmcleod commented Apr 12, 2021

I can not reproduce this. Can list routes with the command. Version: "black-bits/laravel-cognito-auth": "dev-defaultProvider"

From

   {
       "type": "vcs",
       "url": "https://github.com/jaytaph/laravel-cognito-auth"
   }

@MarcosSchlickmann
Copy link

I have this same issue on a fresh start. Perhaps it's because I'm on Laravel 8?

@MarcosSchlickmann
Copy link

It is because of the version. I agree with @phackwer, these routes should be optional or customizable.

In Laravel 8 the authentication scaffolding was changed. I generated it through laravel/breeze and these are the generated files in app/Http/Controllers/Auth:

AuthenticatedSessionController.php
ConfirmablePasswordController.php
EmailVerificationNotificationController.php
EmailVerificationPromptController.php
NewPasswordController.php
PasswordResetLinkController.php
RegisteredUserController.php
VerifyEmailController.php

In Laravel 6 these are the files scaffolded by laravel/ui in app/Http/Controllers/Auth:

ConfirmPasswordController.php
ForgotPasswordController.php
LoginController.php
RegisterController.php
ResetPasswordController.php
VerificationController.php

@phackwer
Copy link
Author

@MarcosSchlickmann I've made a fork to comment the routes from the service provider of the package till someone answer this request.

https://github.com/4cme/laravel-cognito-auth

In my case we have an app so the laravel is all API oriented, no views there other than the jsons. I think that it the best approach in this case would be to isolate screens/views and routes as an isolated package that uses the core of the package to talk to cognito.

@phackwer
Copy link
Author

BTW: the forked package also fixes the error I had on 104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants