laravel check between 2 integer from database
In database I have simple table as
payment_setting with some column as
id,min,max,... now I can use this below code to check between 2 integer:
'amount' => 'required|integer|between:1,10'
but I want to use
payment_setting table to check between integers, like with:
'amount' => 'required|integer|between:payment_setting.min,payment_setting.max'
can I check validation like with that?
Try something like this:
$ps = DB::table('payment_settings')->where('id', $id)->first(); $rules = [ 'amount' => "required|integer|between:$ps->min,$ps->max" ];
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?