daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $i = 0;
  2. foreach ($json_array as $key => $value) {
  3.  
  4.    $params contains employee_id's and employee_name's
  5.  
  6.    $i = $i + 1;      
  7.  
  8.    Validator::make($params, [
  9.             'employee_id'         => 'required|integer|exists:employees,employee_id',
  10.             'employee_name'       => 'required|string',    
  11.         ])->validate();
  12. }
  13.    
  14. $i = 0;
  15. foreach ($json_array as $key => $value) {
  16.     $i = $i + 1;;
  17.     $messages = [
  18.       'required' => 'The :attribute is required in the line '.$i.'.',
  19.     ];
  20.     Validator::make($params, [
  21.         'employee_id'         => 'required|integer|exists:employees,employee_id',
  22.         'employee_name'       => 'required|string',    
  23.     ],$messages)->validate();
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top