black-bits / laravel-cognito-auth

MIT License
89 stars 51 forks source link

Trait method guard has not been applied, because there are collisions with other trait methods #39

Closed ceceps closed 3 years ago

ceceps commented 3 years ago

I work on Laravel 8, and I had follow instruction to set up this package on config/auth.php changed guard like this

'guards' => [
        'web' => [
            'driver' => 'cognito', //session
            'provider' => 'users',
        ],

also had fill config/cognito.php with constant at file .env with my own setup of Cognito User Pool

I create new route on routes/web.php like this :


use App\Http\Controllers\AuthenticateController;

Route::post('login',[AuthenticateController::class,'login'])->name('login');
Route::get('register',[AuthenticateController::class,'register'])->name('register');

on this file I also don't call Auth::routes() as usuall

and in controller AuthenticateController like this,

<?php
use BlackBits\LaravelCognitoAuth\Auth\AuthenticatesUsers;
use BlackBits\LaravelCognitoAuth\Auth\RegistersUsers;
use BlackBits\LaravelCognitoAuth\Auth\ResetsPasswords;

class AuthenticateController extends Controller
{
      use AuthenticatesUsers, RegistersUsers, ResetsPasswords;

    public function showLogin(){
        return view('auth.login');
    }

}

but when I test of route with command php artisan route:list has given error like this :

  Trait method guard has not been applied, because there are collisions with other trait methods on App\Http\Controllers\AuthenticateController

did I miss configuration?

oheck commented 3 years ago

Hey... Thank you for posting here. Unfortunately we cannot provide in-depth support.