помогите разобрать уже много что перепробовал ни могу исправить
Call to undefined function App\Http\Controllers\array_prepend() {"userId":14,"exception":"[object] (Error(code: 0): Call to undefined function App\\Http\\Controllers\\array_prepend() at /var/www/html/app/Http/Controllers/AdminController.php:29)
public static function log($type, $data, $user_id = null) {
if($user_id == null && Auth::guest()) return;
$json = json_decode(file_get_contents(storage_path().'/actions.json'), true);
$json = array_prepend($json, array(
"id" => $user_id == null ? Auth::user()->id : $user_id,
"type" => $type,
"time" => time(),
"data" => $data
));
file_put_contents(storage_path().'/actions.json', json_encode($json));
}
вторая ошибка
Undefined index: disabled {"userId":1,"exception":"[object] (ErrorException(code: 0):
вот код где ошибка
public static function toggleDisabled($pull) {
$json = json_decode(file_get_contents(storage_path().'/disabled.json'), true);
if(in_array($pull, $json['disabled'])) array_push($json['disabled'], $pull);
else unset($json['disabled'][array_search($pull, $json['disabled'])]);
file_put_contents(storage_path().'/disabled.json', json_encode($json));
return true;
}