Advertisement
LrdArc

Untitled

Sep 8th, 2017
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2.     $Arr['borang'] = $columns->column->map( function( $i, $k )  {
  3.             $i->column_id = $i->id;
  4.             if ( count( $i->table ) ) {
  5.                 $xp = explode( ':', $i->options );
  6.                 $i->row = $xp[0];
  7.                 $i->col = $xp[1];
  8.                 $i->api_id = isset( $xp[2] ) ? $xp[2] : 0;
  9.                 $i->api = Api::select( 'name' )->where( 'id', $i->api_id )->first();
  10.                
  11.             } else $i->options = explode( '<', $i->options );
  12.  
  13.             $i->tables = $i->table->keyBy( 'cell' );
  14.             unset( $i->table );
  15.  
  16.             return $i;
  17.         } );
  18.  
  19.         return response()->json( $Arr );
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement