dataManipulator.php 404 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Database\Eloquent\Collection;
  4. class dataManipulator extends Controller
  5. {
  6. // Convert db array to normal kv-array
  7. static public function objArrToAssoc(Collection $object)
  8. {
  9. $output = array();
  10. foreach ($object as $element) {
  11. $output[$element['key']] = $element['value'];
  12. }
  13. return $output;
  14. }
  15. }