I have a problem: I am using a Laravel passport for my api. I need to write tests. Whenever I use the WithoutMiddleware attribute in my tests, it disables the Implicit route model binding function that I use. Whenever I do not use this trait, I need to authenticate directly from my test. To do this, I need to create an API token through Passport.
The passport, however, must be installed before testing through artisan passport:install , because my tests use the DatabaseTransactions and DatabaseMigrations features. When I do this, the tests take a huge amount of time to run, and I feel that this is not the right way. There is no way to disable auth middleware only? Or any other ideas for this?
source share