Log message #4124670

# At Username Text
# Mar 13th, 16:52 neon1024 Well of course
# Mar 13th, 16:51 slackebot with ApplicantsDegrees_
# Mar 13th, 16:51 willem if i try your code ``` $test = $this->ApplicantsTable ->find() ->where( [ 'Applicants.id' => '00000000-0000-0000-0000-100000000001', ] ) ->contain( [ 'ApplicantsDegrees' => ['Degrees'], ]) ->first(); ``` i get an error _InvalidArgumentException: Applicants is not associated
# Mar 13th, 16:51 willem not sure what you mean by this ```Your `applicants_degrees` join table has more than foreign keys in, so should really have a table instance```
# Mar 13th, 16:47 neon1024 Making your join more verbose `$this->Applicants->find()->contain(['ApplicantsDegrees' => ['Degrees']])`
# Mar 13th, 16:47 neon1024 Your `applicants_degrees` join table has more than foreign keys in, so should really have a table instance
# Mar 13th, 16:46 neon1024 As you want to store data in the join
# Mar 13th, 16:46 neon1024 @willem They’re right that you need a join table instance
# Mar 13th, 16:42 willem could anybody with good knowledge of join tables please help me with this: https://discourse.cakephp.org/t/trying-to-get-additional-data-using-belongstomany-with-multiple-tables/3699 The find does not show the data from other tables using the find. Maybe it should be called differently but i just cannot get this working.
# Mar 13th, 16:35 xinobi dereuromark however it is not possible with the current database and I'm not sure how deep I need to go to fix this
# Mar 13th, 16:33 dereuromark then there is no problem :slightly_smiling_face:
# Mar 13th, 16:33 xinobi dereuromark exactly
# Mar 13th, 16:32 dereuromark there should only be one table, but different roles and additional data etc linked to this.
# Mar 13th, 16:31 dereuromark xinobi: what you want is usually not a good design.
# Mar 13th, 16:30 jeremyharris e.g., override FormAuthenticate::authenticate to iterate through your tables, setting the config userModel and just reusing the default _findUser method
# Mar 13th, 16:29 jeremyharris not the component, but the Authenticate object. that’s where you want to look. Look at FormAuthenticate (or whatever base authenticator you’re using) and extend that to fit your needs
# Mar 13th, 16:28 xinobi jeremyharris I need to pass an array of models... but the base auth component only supports a string so I guess I would need to implement my own component yes
# Mar 13th, 16:26 jeremyharris xinobi you can create additional authenticators that extend the authenticator you’re using (e.g. Form) and add it to your authenticate array, with configuration per-authenticator. For example, create a CustomAuthenticate extends FormAuthenticate, then configure it in the auth component with the different userModel
# Mar 13th, 16:19 xinobi does the auth component support multiple model? I need to authenticate users from different tables
# Mar 13th, 16:00 savant You can invite someone to the CakePHP slack via the invite app: http://cakesf.herokuapp.com/
# Mar 13th, 16:00 savant @ankitgsolanki why did you unpin that?
# Mar 13th, 15:39 dereuromark just debug() the env() part in bootstrap and see/find out.
# Mar 13th, 15:39 greenjam94 ``` /** * Debug Level: * * Production Mode: * false: No error messages, errors, or warnings shown. * * Development Mode: * true: Errors and warnings shown. */ 'debug' => true, ``` But all I see on the page is: `An Internal Server Error Occurred`
# Mar 13th, 15:38 dereuromark depends on your env config
# Mar 13th, 15:38 greenjam94 debugging or not..
# Mar 13th, 15:38 dereuromark the config file? not really.
# Mar 13th, 15:37 greenjam94 gotcha, thanks.. any chance it’s cacheable?
# Mar 13th, 15:37 dereuromark See https://github.com/cakephp/app/blob/master/config/app.default.php#L12 env() part
# Mar 13th, 15:37 dereuromark it can also come from env :slightly_smiling_face:
# Mar 13th, 15:30 greenjam94 also, it’s a test server, nothing in production
# Mar 13th, 15:29 greenjam94 not in version control, it’s something i’m directly changing on the server.. I just don’t see it taking affect
# Mar 13th, 15:26 dereuromark this will then not be shipped (or accidentally deployed) to production
# Mar 13th, 15:26 dereuromark instead in the local file (I call mine app_local.php) you can then overwrite it locally to true
# Mar 13th, 15:26 dereuromark is app.php in version control or not? the one in version control must always be set to false
# Mar 13th, 15:21 greenjam94 a while ago I set debug to false in config/app.php, what do I need to do to re-enable it? Setting it to true doesn’t seem to help
# Mar 13th, 15:13 popperz0r looks good anysson!
# Mar 13th, 15:04 alysson-azevedo http://www.bravo-kernel.com/2015/04/how-to-use-a-cakephp-3-rest-api/
# Mar 13th, 15:03 popperz0r anyone use them, or have any other tools to suggest?
# Mar 13th, 15:03 popperz0r https://github.com/CakeDC/cakephp-api
# Mar 13th, 15:03 popperz0r https://github.com/multidots/cakephp-rest-api
# Mar 13th, 15:03 popperz0r ive seen this repos