protected function save($origin, $short = null)
    {
        $shortener = Shortener::updateOrCreate(
            ['hash' => hash('sha512', $origin)],
            ['url' => $origin, 'short' => $short]
        );

        return $shortener->exists ? $shortener->getKey() : false;
    }
protected function save($origin, $short = null)
    {
        $shortener = Shortener::updateOrCreate(
            ['hash' => hash('sha512', $origin)],
            ['url' => $origin, 'short' => $short]
        );

        return $shortener->exists ? $shortener->getKey() : false;
    }
protected function save ( $ origin , $ short = null ) { $ shortener = Shortener :: updateOrCreate ( [ 'hash' => hash ( 'sha512' , $ origin ) ] , [ 'url' => $ origin , 'short' => $ short ] ) ; return $ shortener -> exists ? $ shortener -> getKey ( ) : false ; }
Save record to database.

@param string $origin
@param string|null $short

@return mixed
Save record to database .