guardAgainstProductionDatabase(); $this->withoutMiddleware(ValidateCsrfToken::class); } private function guardAgainstProductionDatabase(): void { $database = config('database.connections.'.config('database.default').'.database'); if ($database !== 'crm_testing') { throw new RuntimeException(sprintf( 'Refusing to run tests against database "%s". Expected "crm_testing". '. 'Likely cause: stale bootstrap/cache/config.php. Run "php artisan config:clear".', $database )); } } }