lundi 22 février 2016

BelongsToMany Relationship Laravel 5.1

I'm having a problem with Laravel 5.1.

I Have 3 tables to do one task with a checklist.

The idea is that when I select a type of job (as a rating, "re-installation of computers," for example), the task will load a checklist for you to complete before the task.

My Models have:

Model "Tasks" with

- id (integer)
- id_type_of_task (integer)
- description of task (string)

Model "typeOfTaskChecklist" with

- id (integer)
- id_type_task (integer)
- activity (string)

Model "Checklist" with

- id (integer)
- id_task (integer)
- id_activity (integer)
- done (integer)

when I show the task, I carry just right checklist. After saving the activities done, I would like to recharge the task view with the activities already completed, but showing the table of the checklist for each type of task, because if it included a new activity or removed this is the table that should be standard.

I tryed with the hasMany relationship, but doesn't worked :(

Any suggestion?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire