Skip to content

Tag: cakephp

Enabling null on many FKs to same associated table

I have multiple fields setup as FK to the same table. The FK can also be NULL. I keep getting this error: Database structure: Column definition (ie. late_agreement_exception_outcome_recommendation_id): Column relationship (ie. late_agreement_exception_outcome_recommendation_id): ExceptionTable: FK setup to Ex…

CakePHP 3.9 Routing prefixes

I have the following path inside my / Scope: And on my src/Controller/UsersController.php i have api_index() But when i go to the url api/Users/index it says Controller not found, because is asking me to add another UsersController inside a subfolder named Api on Controller folder. Untill Cakephp 2.x using th…

CakePHP4 Edit doesnt update record

Version: 4.2.9 My edit view is populating my inputs with the data, but when I change them and click on save, its not saving but giving me “user has been saved” message. UsersController.php edit function my edit.php Answer Your update code is not complete, you have omitted the patchEntity method.

Checkbox HTML array syntax doesn’t work in CakePHP 4

I have an application in CakePHP 4 where I’m doing the equivalent of what’s described in Make array from checkbox form The markup I have is simple: So somebody could for example check “Service 1” and “Service 3” and omit “Service 2”, e.g. I’ve used the For…

How to upload files to S3 bucket from url directly

I am getting some MMS messages from my users. Those MMS are coming via twilio. So twilio storing those files into their server and I can visit those files from twilio. But in my case, I need to store those files into S3 and show into our system from S3. I can store those files into my local folder or