public function update($link, $payload)
    {
        $payload['external'] = isset($payload['external']) ? $payload['external'] : 0;

        if (!empty($payload['lang']) && $payload['lang'] !== config('cms.default-language', 'en')) {
            return $this->translationRepo->createOrUpdate($link->id, 'Grafite\Cms\Models\Link', $payload['lang'], $payload);
        }

        unset($payload['lang']);

        return $link->update($payload);
    }
public function update($link, $payload)
    {
        $payload['external'] = isset($payload['external']) ? $payload['external'] : 0;

        if (!empty($payload['lang']) && $payload['lang'] !== config('cms.default-language', 'en')) {
            return $this->translationRepo->createOrUpdate($link->id, 'Grafite\Cms\Models\Link', $payload['lang'], $payload);
        }

        unset($payload['lang']);

        return $link->update($payload);
    }
public function update ( $ link , $ payload ) { $ payload [ 'external' ] = isset ( $ payload [ 'external' ] ) ? $ payload [ 'external' ] : 0 ; if ( ! empty ( $ payload [ 'lang' ] ) && $ payload [ 'lang' ] !== config ( 'cms.default-language' , 'en' ) ) { return $ this -> translationRepo -> createOrUpdate ( $ link -> id , 'Grafite\Cms\Models\Link' , $ payload [ 'lang' ] , $ payload ) ; } unset ( $ payload [ 'lang' ] ) ; return $ link -> update ( $ payload ) ; }
Updates Links into database.

@param Link  $link
@param array $input

@return Link
Updates Links into database .