Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In cakephp 3 I got error Unexpected field in POST data

Tags:

cakephp-3.2

In cakephp 3 I got error Unexpected field in POST data. Actually that field is not in my table, but I want to use in controller.

like image 917
Masud Avatar asked Oct 24 '25 21:10

Masud


1 Answers

The Security Component in CakePHP is not forgiving. If you want to allow a field thru that should not go thru the Security Component hashing process, you need to use the unlockedField method that comes with the FormHelper class as such:

$this->Form->unlockField('field');

If this does not work, you will need to provide us with the pertinent code

like image 197
AKKAweb Avatar answered Oct 27 '25 00:10

AKKAweb