title('全校录取人数'); $this->chartLabels(['男生', '女生']); // 图表数据 $this->withChart([0, 0]); // 总数 $this->chartTotal('全部', 344); // $this->dropdown($data); } /** * 处理请求 * @param Request $request * @return void */ public function handle(Request $request) { // 卡片内容 $this->withContent(0, 0, 0); } /** * 设置图表数据. * @param array $data * @return $this */ public function withChart(array $data): AllColleges { return $this->chart([ 'series' => $data, ]); } /** * 卡片内容. * @param int $finished * @param int $pending * @param int $rejected * @return $this */ public function withContent(int $finished, int $pending, int $rejected): AllColleges { return $this->content( <<
全部
{$finished}
男生
{$pending}
女生
{$rejected}
HTML ); } }