classes/Models/Traits/Encodable.php
public function encoding($attribute = 'video')
    {
        $encodings = $this->encodings;
        if (!is_a($encodings, Collection::class)) {
            $encodings = Encoding::hydrate($encodings);
        }

        return $encodings->first(function ($i, $encoding) use ($attribute) {
            return data_get($encoding, 'encodable_attribute') == $attribute;
        });
    }
public function encoding($attribute = 'video')
    {
        $encodings = $this->encodings;
        if (!is_a($encodings, Collection::class)) {
            $encodings = Encoding::hydrate($encodings);
        }

        return $encodings->first(function ($i, $encoding) use ($attribute) {
            return data_get($encoding, 'encodable_attribute') == $attribute;
        });
    }
public function encoding ( $ attribute = 'video' ) { $ encodings = $ this -> encodings ; if ( ! is_a ( $ encodings , Collection :: class ) ) { $ encodings = Encoding :: hydrate ( $ encodings ) ; } return $ encodings -> first ( function ( $ i , $ encoding ) use ( $ attribute ) { return data_get ( $ encoding , 'encodable_attribute' ) == $ attribute ; } ) ; }
Find the encoding for a given database field

@param  string         $attribute
@return Encoding|false
Find the encoding for a given database field