Hi, I am still struggling quite badly with this. In my edit view, I can output the correct Document and the data for that Document. When I submit though and it hits the update function, the Document is an empty Model.
Any advice appreciated.
Thanks
from what i understand the question to be; In your Project model do you have a function that looks something like this document function below?
public function document() { //Document Model whatever that is called. return $this->hasMany('Document', 'documentId', 'id'); }
if you do you can just use it like this $newDocument = $project->document()->create([ array of key values here ]); and you can get all the documents with something like this $projectDocuments = $project->document; or $projectDocuments = $project->document->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community