classes/Fields/VideoEncoder.php
public function wrapAndRender()
    {
        // Check if the model has encodings
        if (($item = $this->getModel()) && method_exists($item, 'encodings')) {

            // If so, get it's encoding model instance
            $this->encoding = $item->encodings()
                ->where('encodable_attribute', $this->model_attribute)
                ->first();

            // Add the data attributes for JS view
            if ($this->encoding) {
                $this->group->data_encode($this->encoding->id);
            }
        }

        // Continue rendering
        return parent::wrapAndRender();
    }
public function wrapAndRender()
    {
        // Check if the model has encodings
        if (($item = $this->getModel()) && method_exists($item, 'encodings')) {

            // If so, get it's encoding model instance
            $this->encoding = $item->encodings()
                ->where('encodable_attribute', $this->model_attribute)
                ->first();

            // Add the data attributes for JS view
            if ($this->encoding) {
                $this->group->data_encode($this->encoding->id);
            }
        }

        // Continue rendering
        return parent::wrapAndRender();
    }
public function wrapAndRender ( ) { // Check if the model has encodings if ( ( $ item = $ this -> getModel ( ) ) && method_exists ( $ item , 'encodings' ) ) { // If so, get it's encoding model instance $ this -> encoding = $ item -> encodings ( ) -> where ( 'encodable_attribute' , $ this -> model_attribute ) -> first ( ) ; // Add the data attributes for JS view if ( $ this -> encoding ) { $ this -> group -> data_encode ( $ this -> encoding -> id ) ; } } // Continue rendering return parent :: wrapAndRender ( ) ; }
Prints out the field, wrapped in its group.

@return string
Prints out the field wrapped in its group .