public function populateLockFields($id)
    {
        // $this->getSave($data);   --> creates new record ;-(
        // $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
        //                              update a parent row: a foreign key constraint fails  ;-(
        // use the model, not the repository, to UPDATE
        $record = $this->model->findOrFail($id);

        $record->locked_by = Auth::user()->id;
        $record->locked_at = date('Y-m-d H:i:s');

        return $record->save();
    }
public function populateLockFields($id)
    {
        // $this->getSave($data);   --> creates new record ;-(
        // $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
        //                              update a parent row: a foreign key constraint fails  ;-(
        // use the model, not the repository, to UPDATE
        $record = $this->model->findOrFail($id);

        $record->locked_by = Auth::user()->id;
        $record->locked_at = date('Y-m-d H:i:s');

        return $record->save();
    }
public function populateLockFields ( $ id ) { // $this->getSave($data);   --> creates new record ;-( // $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or //                              update a parent row: a foreign key constraint fails  ;-( // use the model, not the repository, to UPDATE $ record = $ this -> model -> findOrFail ( $ id ) ; $ record -> locked_by = Auth :: user ( ) -> id ; $ record -> locked_at = date ( 'Y-m-d H:i:s' ) ; return $ record -> save ( ) ; }
Populate the locked_at and locked_by fields.
By definition, this must be an UPDATE

All that is needed is the ID

@param  int     $id
@return bool
Populate the locked_at and locked_by fields . By definition this must be an UPDATE