@extends('layout.app') @section('content') @php // LOGIKA BARU: Ambil nama role user menggunakan relasi pivot $user = auth()->user(); $userRole = 'Anggota'; if ($user && $user->anggota) { if ($user->anggota->roles->contains('nama_role', 'Pengurus')) { $userRole = 'Pengurus'; } elseif ($user->anggota->roles->contains('nama_role', 'Pelatih')) { $userRole = 'Pelatih'; } } @endphp
@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @if(isset($anggota)) @method('PUT') @endif
Informasi Pribadi & Akun
@if(!isset($anggota)) Password default: tapakmp123 @endif
Informasi Organisasi
{{-- Pesan informasi tambahan untuk Pelatih --}} @if($userRole != 'Pengurus') Anda hanya dapat mendaftarkan Anggota biasa. @endif
{{-- BOX SK HANYA DI-RENDER UTUH UNTUK PENGURUS AGAR LEBIH AMAN --}} @if($userRole == 'Pengurus') @endif
@endsection