Support the ongoing development of Laravel.io →
posted 1 year ago
Laravel
0

can anyone help here please

0
moderator

Hello @jbiddulph

The problem is that you access the $course->en variabele that is delivered with the magic __get() function and directly change it.

What you can do is:

    $en =  $course->en;
    $en["config"]["coursesuite"] = $req->coursesuite;
    $en["config"]["coursename"] = $req->coursename;
    $en["config"]["courseid"] = $req->courseid;
    $en["config"]["lms"] = $req->lms;
    $en["config"]["defaultlang"] = $req->defaultlang;

    $course->en = $en;
    $result = $course->save();

    if($result) {
        return ["result"=>"Data is updated successfully"];
    } else {
        return ["result"=>"update operation failed"];
    }

With this method you get the variable, update it and then save it.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.