enh(recently updated): show updatedBy and updated_at
This commit is contained in:
parent
2aace16704
commit
6db64763fe
2 changed files with 14 additions and 3 deletions
|
@ -364,15 +364,17 @@ class PageController extends Controller
|
||||||
*/
|
*/
|
||||||
public function showRecentlyUpdated()
|
public function showRecentlyUpdated()
|
||||||
{
|
{
|
||||||
$pages = Page::visible()->orderBy('updated_at', 'desc')
|
$pages = Page::visible()->with('updatedBy')
|
||||||
|
->orderBy('updated_at', 'desc')
|
||||||
->paginate(20)
|
->paginate(20)
|
||||||
->setPath(url('/pages/recently-updated'));
|
->setPath(url('/pages/recently-updated'));
|
||||||
|
|
||||||
$this->setPageTitle(trans('entities.recently_updated_pages'));
|
$this->setPageTitle(trans('entities.recently_updated_pages'));
|
||||||
|
|
||||||
return view('common.detailed-listing-paginated', [
|
return view('common.detailed-listing-paginated', [
|
||||||
'title' => trans('entities.recently_updated_pages'),
|
'title' => trans('entities.recently_updated_pages'),
|
||||||
'entities' => $pages,
|
'entities' => $pages,
|
||||||
|
'showUpdatedBy' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,13 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if(($showUpdatedBy ?? false) && $entity->relationLoaded('updatedBy') && $entity->updatedBy)
|
||||||
|
<small title="{{ $entity->updated_at->toDayDateTimeString() }}">
|
||||||
|
{!! trans('entities.meta_updated_name', [
|
||||||
|
'timeLength' => $entity->updated_at->diffForHumans(),
|
||||||
|
'user' => e($entity->updatedBy->name)
|
||||||
|
]) !!}
|
||||||
|
</small>
|
||||||
|
@endif
|
||||||
|
|
||||||
@endcomponent
|
@endcomponent
|
Loading…
Reference in a new issue