Is it correct that I created "dev_id" column in "software" table, which is a foreign key to "id" in "developers" table? Yes.
Now, for the addSoftware method, try to move as much code as you can from the controller to the model.
First of all, you need a Developer, so if it doesn't exist -> create one. Then, check if the software exists, if it doesn't -> create one. Finally, update the software' release_date.
Also, have you read about RESTful?, this is a very nice tutorial: http://www.slideshare.net/landlessness/teach-a-dog-to-rest
Check this too: http://laravel.com/docs/eloquent#inserting-related-models
Greetings.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community