コトの発端
認証を自分で組んでたら、Auth::attempt実行時にTypeErrorエラーが発生した。
エラー内容
Illuminate\Auth\EloquentUserProvider::validateCredentials(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, App\Models\User given ...

Authenticatableが渡されるところに、Modelが渡されてるってこと?
Auth::attempt()にはただの配列(credentials)しか渡した覚えないけど、裏側でユーザ情報のモデルを渡しているっぽい。
解決
UserモデルをAuthenticatableを継承して定義していなかったのが原因。
app/Models/User.php
...
class User extends Model
{
...
下記の通り、Authenticatableを継承して定義しなおすことで解決。
...
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
...
Laravelインストール時のUserモデルをそのまま使用していれば発生しにくい問題であるが、Userモデルを自作しなおした結果、発生した問題であった。
あっきーの場合
あっきーの場合は上記の修正後に、Array to string conversionのエラーが発生した。

こちらの原因はprimaryKeyを配列にしていたことが原因であった。

配列を解除して正常動作した。

たまたま単一主キーやけど、複合主キーの場合はどないするんやろか。。。。
参考
Laravelでデータベース内の別テーブルでログインを切り替える方法
https://solomaker.club/how-to-use-another-table-as-login-in-laravel/
Error "Array to string conversion" when use Authentication in laravel
いつもの
記事の内容については無保証です。