toArray(), [ 'title' => 'required|min:15', ]); } /** * Determine if the given coupon_code is valid for verify status. * * @param CouponCode $coupon_code * * @return bool / Validator */ public function verify(CouponCode $coupon_code) { return Validator::make($coupon_code->toArray(), [ 'title' => 'required|min:15', 'status' => 'in:complete', ]); } /** * Determine if the given coupon_code is valid for approve status. * * @param CouponCode $coupon_code * * @return bool / Validator */ public function approve(CouponCode $coupon_code) { return Validator::make($coupon_code->toArray(), [ 'title' => 'required|min:15', 'status' => 'in:verify', ]); } /** * Determine if the given coupon_code is valid for publish status. * * @param CouponCode $coupon_code * * @return bool / Validator */ public function publish(CouponCode $coupon_code) { return Validator::make($coupon_code->toArray(), [ 'title' => 'required|min:15', 'description' => 'required|min:50', 'status' => 'in:approve,archive,unpublish', ]); } /** * Determine if the given coupon_code is valid for archive status. * * @param CouponCode $coupon_code * * @return bool / Validator */ public function archive(CouponCode $coupon_code) { return Validator::make($coupon_code->toArray(), [ 'title' => 'required|min:15', 'description' => 'required|min:50', 'status' => 'in:approve,publish,unpublish', ]); } /** * Determine if the given coupon_code is valid for unpublish status. * * @param CouponCode $coupon_code * * @return bool / Validator */ public function unpublish(CouponCode $coupon_code) { return Validator::make($coupon_code->toArray(), [ 'title' => 'required|min:15', 'description' => 'required|min:50', 'status' => 'in:publish', ]); } }