Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mehmetanbaki's avatar

Token API

Hey Laravelers

Is there any way to create user token api without using passport ???

0 likes
1 reply
hjortur17's avatar

You can just create random string when the user is created. For example:

$user = User::create([
	'name' => $data['name'],
	'email' => $data['email'],
	'password' => Hash::make($data['password']),
	'api_token' => Str::random(60),
]);

Please or to participate in this conversation.