make custom validation in laravel

i new in laravel i trying to make custom validation rule to validate name of brand i make this rule and worked normally :- public function update(Request $request, $id) { //prepare data for validation request()->validate([ ‘name’ => [ ‘required’, ‘min:2’, // validate english name is exist before **function ($attribute, $value, $fail) { $englishname=Brand::where([‘name’=>$value,’deleted’=>1 ])->first(); if(false…

Details

Comparing two values in a dataframe while iterating using iterrows

When I run the code below, I get this error: ValueError: (‘The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().’, ‘occurred at index 0’) def execute_fnc(x): for index, row in df.iterrows(): if df[‘first’] < df[‘last’]: df[‘a’] = False df[‘b’] = df[‘c’] else: df[‘a’] = True df[‘b’] = df[‘c’] +…

Details

Handlebars: Access has been denied to resolve the property “from” because it is not an “own property” of its parent

I am using a Nodejs backend with server-side rendering using handlebars. After reading a doc array of objects from handlebars, which contains key “content” and “from”. However when I try to use #each to loop through the array of objects, the error “Handlebars: Access has been denied to resolve the property “from” because it is…

Details