Add relations in tables, add saving states for datatables, minor fixes
This commit is contained in:
20
app/Repositories/Core/Arrays.php
Normal file
20
app/Repositories/Core/Arrays.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Core;
|
||||
|
||||
class Arrays
|
||||
{
|
||||
public static function changeKeyName($array, $newkey, $oldkey)
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$array[$key] = self::changeKeyName($value, $newkey, $oldkey);
|
||||
} else {
|
||||
$array[$newkey] = $array[$oldkey];
|
||||
}
|
||||
}
|
||||
unset($array[$oldkey]);
|
||||
return $array;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user