Migrate Auth PHP native to laravel with API

I have example PHP native for auth with API and its working:

This fungsi.php:

This fungsi.php

This login.php

This login.php

and this home.php

and this home.php

this my example controller auth laravel:

this my example controller auth laravel

I already try it with guzzle or sanctum but didn’t work.

I use laravel 10 but if the project need laravel 11 I ready to upgrade it.

Can someone please help me?