diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f880473..f51fdb7 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -34,7 +34,7 @@ class HomeController extends Controller $malePersonList = User::where('gender_id', 1)->pluck('nickname', 'id'); $femalePersonList = User::where('gender_id', 2)->pluck('nickname', 'id'); - return view('home', [ + return view('users.show', [ 'currentUser' => $user, 'usersMariageList' => $usersMariageList, 'malePersonList' => $malePersonList, diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index a8e6760..91c7794 100644 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -54,7 +54,7 @@ class UsersController extends Controller $malePersonList = User::where('gender_id', 1)->pluck('nickname', 'id'); $femalePersonList = User::where('gender_id', 2)->pluck('nickname', 'id'); - return view('home', [ + return view('users.show', [ 'currentUser' => $user, 'usersMariageList' => $usersMariageList, 'malePersonList' => $malePersonList, diff --git a/app/User.php b/app/User.php index 7f71c01..ae22fe7 100644 --- a/app/User.php +++ b/app/User.php @@ -92,8 +92,7 @@ class User extends Authenticatable public function profileLink() { - $linkText = $this->name ?: $this->nickname; - return link_to_route('users.show', $linkText, [$this->id]); + return link_to_route('users.show', $this->name, [$this->id]); } public function wifes() diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php deleted file mode 100644 index 14daab1..0000000 --- a/resources/views/home.blade.php +++ /dev/null @@ -1,160 +0,0 @@ -@extends('layouts.app') - -@section('content') -
| Nama Panggilan | -{{ $currentUser->nickname }} | -
|---|---|
| Nama | -{{ $currentUser->profileLink() }} | -
| Jenis Kelamin | -{{ $currentUser->gender }} | -
| Ayah | -
- @if ($currentUser->father_id)
- {{ $currentUser->father->profileLink() }}
- @else
- {{ Form::open(['route' => ['family-actions.set-father', $currentUser->id]]) }}
- {!! FormField::select('set_father_id', $malePersonList, ['label' => false]) !!}
-
- {{ Form::text('set_father', null, ['class' => 'form-control input-sm']) }}
-
- {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_father_button']) }}
-
-
- {{ Form::close() }}
- @endif
- |
-
| Ibu | -
- @if ($currentUser->mother_id)
- {{ $currentUser->mother->profileLink() }}
- @else
- {{ Form::open(['route' => ['family-actions.set-mother', $currentUser->id]]) }}
- {!! FormField::select('set_mother_id', $femalePersonList, ['label' => false]) !!}
-
- {{ Form::text('set_mother', null, ['class' => 'form-control input-sm']) }}
-
- {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_mother_button']) }}
-
-
- {{ Form::close() }}
- @endif
- |
-
| Isteri | -
- @if ($currentUser->wifes->isEmpty() == false)
-
- {{ Form::text('set_wife', null, ['class' => 'form-control input-sm']) }}
-
- {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_wife_button']) }}
-
-
- {{ Form::close() }}
- @endif
- |
-
|---|---|
| Suami | -
- @if ($currentUser->husbands->isEmpty() == false)
-
- {{ Form::text('set_husband', null, ['class' => 'form-control input-sm']) }}
-
- {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_husband_button']) }}
-
-
- {{ Form::close() }}
- @endif
- |
-
| Ayah | +
+ @if ($user->father_id)
+ {{ $user->father->profileLink() }}
+ @else
+ {{ Form::open(['route' => ['family-actions.set-father', $user->id]]) }}
+ {!! FormField::select('set_father_id', $malePersonList, ['label' => false]) !!}
+
+ {{ Form::text('set_father', null, ['class' => 'form-control input-sm']) }}
+
+ {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_father_button']) }}
+
+
+ {{ Form::close() }}
+ @endif
+ |
+
|---|---|
| Ibu | +
+ @if ($user->mother_id)
+ {{ $user->mother->profileLink() }}
+ @else
+ {{ Form::open(['route' => ['family-actions.set-mother', $user->id]]) }}
+ {!! FormField::select('set_mother_id', $femalePersonList, ['label' => false]) !!}
+
+ {{ Form::text('set_mother', null, ['class' => 'form-control input-sm']) }}
+
+ {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_mother_button']) }}
+
+
+ {{ Form::close() }}
+ @endif
+ |
+
| Isteri | +
+ @if ($user->wifes->isEmpty() == false)
+
+ {{ Form::text('set_wife', null, ['class' => 'form-control input-sm']) }}
+
+ {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_wife_button']) }}
+
+
+ {{ Form::close() }}
+ @endif
+ |
+
| Suami | +
+ @if ($user->husbands->isEmpty() == false)
+
+ {{ Form::text('set_husband', null, ['class' => 'form-control input-sm']) }}
+
+ {{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_husband_button']) }}
+
+
+ {{ Form::close() }}
+ @endif
+ |
+
| Nama | ++ {{ $user->profileLink() }} + | +
|---|---|
| Nama Panggilan | +{{ $user->nickname }} | +
| Jenis Kelamin | +{{ $user->gender }} | +
| Tanggal Lahir | +{{ $user->dob }} | +
| Meninggal | +{{ $user->dod }} | +
| {{ $user->email }} | +|
| Telp | +{{ $user->phone }} | +
| Alamat | +{!! nl2br($user->address) !!} | +