src/Repositories/Repository.php
public function getPivotFields($obj, $prop)
    {
        $reflection = new \ReflectionClass($obj);
        $property = $reflection->getProperty($prop);
        $property->setAccessible(true);
        $value = $property->getValue($obj);
        $property->setAccessible(false);
        
        /* Remove timestamp from pivot */
        return array_diff($value, [
            'deleted_at',
            'created_at',
            'updated_at'
        ]);
    }
public function getPivotFields($obj, $prop)
    {
        $reflection = new \ReflectionClass($obj);
        $property = $reflection->getProperty($prop);
        $property->setAccessible(true);
        $value = $property->getValue($obj);
        $property->setAccessible(false);
        
        /* Remove timestamp from pivot */
        return array_diff($value, [
            'deleted_at',
            'created_at',
            'updated_at'
        ]);
    }
public function getPivotFields ( $ obj , $ prop ) { $ reflection = new \ ReflectionClass ( $ obj ) ; $ property = $ reflection -> getProperty ( $ prop ) ; $ property -> setAccessible ( true ) ; $ value = $ property -> getValue ( $ obj ) ; $ property -> setAccessible ( false ) ; /* Remove timestamp from pivot */ return array_diff ( $ value , [ 'deleted_at' , 'created_at' , 'updated_at' ] ) ; }
Get array fields fillable from Pivot Relation

@return array
Get array fields fillable from Pivot Relation