Category : synchronization

Hi I have User and Task models. and user_task table. In view there are two inputs user_id and observer_id. I want to sync from two inputs with different parameters.Problem is first input is not saving. Controller: $data = $request->all(); $data[‘file’] = Task::uploadFile($request); $task = Task::create($data); $task->user()->sync($request->user_id,[‘role’ => 1]); $task->user()->sync($request->observer_id,[‘role’ => 2]); Sourc..

Read more

I’m unable to register extra fields in a pivot table: This my scheme: Buyer Model: public function qualities(){ //many-to-many relation return $this->belongsToMany(Quality::class); } Quality Model: public function qualities(){ //many-to-many relation return $this->belongsToMany(Quality::class); } Product Model: public function buyers(){ //many-to-many relation return $this->belongsToMany(Buyer::class); } Before of send the data to the sync function, I’m combining the ..

Read more

What I’m trying to achieve is to sync mobile app data with server database. I was thinking for an optimal solution because fetching all data from the server and updating mobile app this way is not very optimal solution. I came up with this thought to implement: Mobile app will send list of id’s and ..

Read more

I currently have code referencing vuejs packages to handle dragging & dropping and it IS WORKING. Packages: src="//cdn.jsdelivr.net/npm/[email protected]/Sortable.min.js" src="//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.19.2/vuedraggable.umd.min.js" src="//unpkg.com/axios/dist/axios.min.js" I have a series of checkbox items all bound to a single v-model named "choices." Snippet of template code: <div class="form-group"> // One of the labels for the checkboxes… <div class="col-sm-2" style="text-align: center"> <label class="control-label">@lang(‘messages.fields.category’)</label> ..

Read more

I would like to use a ‘userables’ table to store user relationship to various other models, such as ‘Projects’ and ‘Actions’. The user relationship also has an attribute, such as "Owner" or "Contributor". I’m having trouble syncing (and/or attaching and detaching) the relationships with this additional attribute, despite trying various similar posts and scrutinising the ..

Read more