classes/Models/Encoding.php
public function onCreating()
    {
        // Delete any other encoding jobs for the same parent and field
        self::where('encodable_type', '=', $this->encodable_type)
            ->where('encodable_id', '=', $this->encodable_id)
            ->where('encodable_attribute', '=', $this->encodable_attribute)
            ->delete();

        // Default values
        $this->status = 'pending';
    }
public function onCreating()
    {
        // Delete any other encoding jobs for the same parent and field
        self::where('encodable_type', '=', $this->encodable_type)
            ->where('encodable_id', '=', $this->encodable_id)
            ->where('encodable_attribute', '=', $this->encodable_attribute)
            ->delete();

        // Default values
        $this->status = 'pending';
    }
public function onCreating ( ) { // Delete any other encoding jobs for the same parent and field self :: where ( 'encodable_type' , '=' , $ this -> encodable_type ) -> where ( 'encodable_id' , '=' , $ this -> encodable_id ) -> where ( 'encodable_attribute' , '=' , $ this -> encodable_attribute ) -> delete ( ) ; // Default values $ this -> status = 'pending' ; }
Set default fields and delete any old encodings for the same source.

@return void
Set default fields and delete any old encodings for the same source .