Hey guys,
I'm fairly confident the issue here is my lacking knowledge for how all this logically works together. I've read through the documentation a fair few times for models and I'm still not fully understanding what I'm missing in my code.
tl;dr: I have a model called 'Client' which has a 'hasMany' relationship with 'Clientcontactstype'. 'Clientcontactstype' has a 'belongsTo' relation back to 'Client' These models were generated using Phalon developer tools (Which I know can be buggy, but it seems to of gotten it right)
Here's the source for reference:
Clientcontactstype Model https://pastebin.com/sXKUzrjH
Client Model https://pastebin.com/NAg1caVj
Controller code https://pastebin.com/GctGiFWL
The problem code lies at line 11 on the Controller code:
Catchable fatal error: Object of class Client could not be converted to string
$clientContactType->client = $customer;
Am I right in saying that I shouldn't have to directly reference the $customer's ID, I should be able to use the model object itself? or am I missing something here.