Skip to content

Commit

Permalink
Update LoginApiController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdianS18 committed Nov 13, 2024
1 parent 15c02b0 commit 6bc71e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/LoginApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function login(Request $request)

public function user_detail(User $user)
{
if ($user->roles()->pluck()->name == 'student') {
if ($user->roles->pluck('name')[0] == 'student') {
$student = $this->student->whereUserId($user->id);
return response()->json(['status' => 'success', 'message' => "Data Berhasil di Tambahkan", 'code' => 200, 'data' => [
'nisn' => $student->nisn,
Expand Down

0 comments on commit 6bc71e9

Please sign in to comment.