dimanche 22 décembre 2019

Laravel - rename key associative array with the 'as' keyword?

Is there a way to easily rename a key in an associative array without extra complexity?

for example

public function rules()
 {
   return [
    'candidateID' => 'required|number', **as candidate_id**
    'note'        => 'required|string',
   ];
 }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire