diff --git a/README.md b/README.md index 12e07b8..095f829 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,4 @@ class YourResource extends Resource { Then, in resource detail page, you can see the history of your resource status. ## Images +![status](https://user-images.githubusercontent.com/41853913/51896859-0d8ee780-23b6-11e9-894f-e214382776a6.PNG) diff --git a/src/Models/Status.php b/src/Models/Status.php index 5c31f0e..abdedf1 100644 --- a/src/Models/Status.php +++ b/src/Models/Status.php @@ -28,4 +28,8 @@ public function getDateAttribute() { return $this->created_at? $this->created_at->format('Y-m-d H:i') : ''; } + public function getCreatorNameAttribute() { + return $this->creator? $this->creator->name?? '' : ''; + } + } diff --git a/src/Resources/Status.php b/src/Resources/Status.php index 6fd4d0a..93f489e 100644 --- a/src/Resources/Status.php +++ b/src/Resources/Status.php @@ -18,6 +18,8 @@ public function fields(Request $request) return [ Text::make('Status', 'status'), Text::make('Date', 'date'), + Text::make('By', 'creator-name'), + Text::make('Note', 'note'), ]; }