Welcome Guest, Not a member yet? Register   Sign In
How to validate data with in_list inside model
#1

I am trying to do clean-up in my controllers by moving my validation rules to the model class but unfortunately i came to realize there is no clear documentation on how to pass values to be tested into the validation rules. I have been searching for a solution without luck.

NB: the in_list values are expected to come from the database, so the list is dynamic 

PHP Code:
protected $validationRules = [
    'id' => 'required|in_list[list_of_ids_from_db]'
]; 
Reply


Messages In This Thread
How to validate data with in_list inside model - by llyimo1920 - 04-18-2021, 12:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB