mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
[api] reward + thanks
This commit is contained in:
@@ -93,4 +93,20 @@ class NewsController extends Controller
|
||||
$result = $this->repository->delete($id);
|
||||
return $this->success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo update the unread cache
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function latest()
|
||||
{
|
||||
$result = News::query()->orderBy('id', 'desc')->first();
|
||||
$resource = new NewsResource($result);
|
||||
$resource->additional([
|
||||
'site_info' => site_info(),
|
||||
]);
|
||||
return $this->success($resource);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user