<commit_before><?php namespace app\Services;

use App\Models\Benefiters_Tables_Models\Benefiter;
use App\Models\Benefiters_Tables_Models\BenefiterReferrals;
use App\Services\DatesHelper;
use Validator;

class BasicInfoService{

    private $datesHelper;

    public function __construct(){
        // initialize dates helper
        $this->datesHelper = new DatesHelper();
    }

    // validate the basic info
    public function basicInfoValidation($request, $id){
        $rules = array(
            'folder_number' => 'max:255|required|unique:benefiters,folder_number,'.$id,
            'name' => 'max:255',
            'lastname' => 'max:255',
            'fathers_name' => 'max:255',
            'mothers_name' => 'max:255',
            'nationality_country' => 'max:255',
            'origin_country' => 'max:255',
            'ethnic_group' => 'max:255',
            'birth_date' => 'date',
            'arrival_date' => 'date',
            'address' => 'max:255',
            'telephone' => 'min:5|max:20',
            'number_of_children' => 'integer',
            'chidren_names' => 'max:2000|required',
            'relatives_residence' => 'max:255',
            'country_abandon_reason' => 'max:255',
            'travel_route' => 'max:255',
            'travel_duration' => 'max:255',
            'detention_duration' => 'max:255',
            'social_history' => 'max:2000',
        );
        $legal_status_texts = $request['legal_status_text'];
        foreach($legal_status_texts as $legal_status_text){
            array_push($rules, [$legal_status_text => 'max:255|required']);
        }
        $legal_status_exp_dates = $request['legal_status_exp_date'];
        foreach($legal_status_exp_dates as $legal_status_exp_date){
            array_push($rules, [$legal_status_exp_date => 'date|required']);
        }<commit_msg>the children_names field shouldn't be required<commit_after><?php namespace app\Services;

use App\Models\Benefiters_Tables_Models\Benefiter;
use App\Models\Benefiters_Tables_Models\BenefiterReferrals;
use App\Services\DatesHelper;
use Validator;

class BasicInfoService{

    private $datesHelper;

    public function __construct(){
        // initialize dates helper
        $this->datesHelper = new DatesHelper();
    }

    // validate the basic info
    public function basicInfoValidation($request, $id){
        $rules = array(
            'folder_number' => 'max:255|required|unique:benefiters,folder_number,'.$id,
            'name' => 'max:255',
            'lastname' => 'max:255',
            'fathers_name' => 'max:255',
            'mothers_name' => 'max:255',
            'nationality_country' => 'max:255',
            'origin_country' => 'max:255',
            'ethnic_group' => 'max:255',
            'birth_date' => 'date',
            'arrival_date' => 'date',
            'address' => 'max:255',
            'telephone' => 'min:5|max:20',
            'number_of_children' => 'integer',
            'chidren_names' => 'max:2000',
            'relatives_residence' => 'max:255',
            'country_abandon_reason' => 'max:255',
            'travel_route' => 'max:255',
            'travel_duration' => 'max:255',
            'detention_duration' => 'max:255',
            'social_history' => 'max:2000',
        );
        $legal_status_texts = $request['legal_status_text'];
        foreach($legal_status_texts as $legal_status_text){
            array_push($rules, [$legal_status_text => 'max:255|required']);
        }
        $legal_status_exp_dates = $request['legal_status_exp_date'];
        foreach($legal_status_exp_dates as $legal_status_exp_date){
            array_push($rules, [$legal_status_exp_date => 'date|required']);
        }
{'fraction_non_alphanumeric': 0.14555256064690028, 'fraction_numerical': 0.03018867924528302, 'mean_word_length': 2.65255905511811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '501334', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1117, 'n_words': 185}