Where are the Auth/Login controllers in Laravel 9 and sanctum?
Laravel documents refer to LoginController (some people name it AuthController) which is not created by installing neither Laravel nor Sanctum.
I need to use my custom tables with Sanctum and I need to override the columns names and logic of login.
Should I create it manually? and why it's generated automatically in previous versions?
@InfoRR and the link you shared says you might not want to use the starter kits which provides all of that for you, and gives you an option to create your own LoginController as an example. Otherwise it will share just a function or couple of lines of code, not a full controller.
@Nakov I realize it's not there. I thought there might be a kit that generates it or something of that kind, since it's widely used in tutorials but not explicitly mentioned to be manually created.
One more question, when I create this new controller, how can I reference it / use it properly?
@InfoRR I hope you are reading what I am saying my friend. But I mentioned couple of times already that Laravel provides Starter kits, and there is a link to them in my very first reply. You just need to click on the links, and they will get you there. So it is not out of the box, once you install Laravel, but you need to chose which one you like and just install it and then EVERYTHING will be set up for you.
@Nakov Thank you again for being patient with me. In fact I read your comments well. I understand that there are two main starter kits for Laravel auth. I actually have three projects side by side in my plain Laravel, Breeze and Jetstream, and none of them has such controller out of the box.
My issue is that I have a database ready with "users" table different from Laravel convention, and I need to use Sanctum with this setup. Therefore I need to use custom code for authentication, yet I'm trying my best to find the best "Laravel way" to do it, with minimum change to the built is authentication that comes with Sanctum.
@inforr the Manually Authenticating Users section, you setup yourself, just copy and paste the code provided by @taylorotwell I use it in a project. If new to starter kits, I suggest Breeze. Or use UI.
@jlrdw I'm bound to Sanctum. I need to create an all API project, and I don't need any user interfaces generated. However I need to have custom table name, and email & password fields.
@Snapey totally agree, and I'm sorry that that question moved to another direction.
My question was though just about LoginController in the first place, just to keep the question concise, and I was thinking about creating a new question based on the answer I get. However, I got caught of explaining myself by trailing back to the origin of the issue.
I guess I thought wrong...