HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/demo.sports-crowd.com/app/Http/Controllers/ChangelogsController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Log;
use App\Changelog;
use App\Module;
use Datatables;

class ChangelogsController extends Controller
{
    public function index()
    {
        $rol = Auth::user()->rol->id;
        return view('changelogs.changelogs')->with('rol', $rol);
    }

    public function indexAdd()
    {
        return view('changelogs.addChangelog');
    }

    public function create(Request $request)
    {
        $changelog = new Changelog();
        $changelog->title =  $request["title"];
        $changelog->description =  $request["description"];
        $changelog->save(); //Guarda el nuevo objeto

        $logObject = $changelog;
        $this->registerLog(Auth::user()->id, 'Creó un changelog', json_encode($logObject), "Create", 5);

        if ($changelog) {
            return array('r' => true, 'd' => null, 'm' => trans('messages.screen_changelogs_tag8'));
        } else {
            return array('r' => false, 'd' => null, 'm' => trans('messages.screen_changelogs_tag9'));
        }
    }

    public function tableFilter()
    {
        $module = Module::select('id')->where("route", "ticketing")->first();
        $instance = new Module();
        $modules = json_encode($instance->modulesTreeId(null, $module->id));
        $modules = substr($modules, 1, -1);
        $modules = explode(',', $modules);

        $logs = Log::with(['user', 'module'])->whereIn('logs.module_id', $modules)->orderBy('id', 'DESC');
        return Datatables::of($logs)
            ->editColumn('data_operation', function ($logs) {
                return '<pre id="json' . $logs->id . '">' . $logs->data_operation . '</pre>';
            })
            ->rawColumns(['data_operation'])
            ->make(true);
    }
}