Laravel 5.5 Type error: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Laravel 5.5 Type Error Resolution: Understanding Argument Types and Authentication Flow Introduction: You might have come across this error while working on your Laravel 5.5 project: "Type error: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\Model\UserAdmin given..." This issue occurs when you are using the wrong data type while passing arguments through authentication methods. In this blog post, we'll explain the problem thoroughly and provide solutions to resolve it. 1. Understand the error message: The error is related to the validation method for credentials in your application. It states that the first argument passed to validateCredentials() should be an instance of Illuminate\Contracts\Auth\Authenticatable, while you're using another class (App\Model\UserAdmin) which is not a valid instance for this specific requirement. 2. Check your LoginController: In your LoginController extending AuthenticatesUsers, check the user data being used to perform authentication. Make sure that it is of type Illuminate\Contracts\Auth\Authenticatable or its subclass. If you're using custom models, create a User class that extends from Illuminate\Foundation\Auth\User:
namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable {
    // Your custom user model methods and properties
}
3. Implement proper authentication flow: Laravel's Authentication system simplifies your login process by providing various traits such as AuthenticatesUsers. However, you need to ensure that the data types are correct while performing these tasks. If you want more control over the authentication flow, you can create a custom Login Controller extending Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers or a simple AuthController using Illuminate\Support\Facades\Auth:
namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers as AuthenticatesAndRegistersUsersTrait,
	Illuminate\Support\Facades\Auth,
    Illuminate\Http\Request;
class LoginController extends Controller {
	// Your custom authentication logic using AuthenticatesAndRegistersUsersTrait or Auth facade
}
4. Use proper data types: When creating your registration controller or model, ensure that you're using the correct data type for the validation process. By sticking to Laravel conventions and best practices, you can avoid encountering such errors in your application. Make sure to use Illuminate\Contracts\Auth\Authenticatable if it fits your scenario. Conclusion: Understanding argument types and authentication flow is crucial when working with Laravel 5.5. By following these guidelines, you'll be able to write cleaner code and avoid runtime errors in your application. If you encounter issues or need professional guidance, feel free to reach out to the team at https://laravelcompany.com for help and support.