Advanced: Override the page content by your PHP Class/method/function
For an advanced developer, you can override the page content by your PHP Class/method/function by using the special_text like below:
{
"php_class":"App\\Http\\Controllers\\CourseController",
"class_method": "index",
"parameters":{"university_id":"329","school_type":"1"}
}
This will call the index() in your own PHP class App\Http\Controllers\CourseController. You can pass some parameters to the method.
CourseController Code example:
public function index($data, $parameters) { if (request()->course_level && isset($parameters->university_id)) { return $this->showUniversityDetails($data, $parameters); } elseif (request()->course_id) { return $this->showCourseDetails($data, $parameters); } elseif (request()->all_university) { $data['page']->main_content = $this->showUniversityLinks($data, $parameters); // only change the main_content
return $data; } return $data; }
$data is a collection of the page. Please use dd($data) to see what's in it.