protected function validate(Data $data) { if (!$data->title) { throw new ValidFailException('Require Title'); } if (!UserHelper::isAdmin()) { throw new ValidFailException('Permission deny'); } }