user(); if (config('ninja.app_env') == 'local') { return true; } return $user->account->isPaid() && $user->isAdmin() && $user->company()->legal_entity_id != null; } /** * @return array|string> */ public function rules(): array { return [ 'acts_as_receiver' => ['required', 'bool'], 'acts_as_sender' => ['required', 'bool'], ]; } public function prepareForValidation() { $input = $this->all(); $this->replace($input); } // public function after(): array // { // return [ // function (Validator $validator) { // if ($this->input('acts_as_sender') === false && $this->input('acts_as_receiver') === false) { // $validator->errors()->add('acts_as_receiver', ctrans('texts.acts_as_must_be_true')); // } // } // ]; // } }