Become a member
Sign in
Juhász Zsolt
Juhász Zsolt

Juhász Zsolt

19 Following
  • Profile
  • Claps
  • Highlights

Highlighted by Juhász Zsolt

See more

From Create REST API in Laravel with authentication using Passport by Urjit Rajgor

/**
* login api
*
* @return \Illuminate\Http\Response
*/
public function login(){
if(Auth::attempt(['email' => request('email'), 'password' => request('password')])){
$user = Auth::user();
$success['token'] = $user->createToken('MyApp')-> accessToken;
return response()->json(['success' => $success], $this-> successStatus);

}
else{
return response()->json(['error'=>'Unauthorised'], 401);
…

Claps from Juhász Zsolt

See more

The Smart Way To Handle Request Validation In Laravel 😎

KashYap Merai

Build authentication into your Laravel API with JSON Web Tokens (JWT)

Connor Leech

The Secret to Being a Top Developer Is Building Things! Here’s a List of Fun Apps to Build!

Indrek Lasn