I wanted to duplicate or create a new page of the View for the purpose of separating members and admins what to do on the specific view page. However, the duplicate or a created New Page of the View throws an error message on the list page that relates with the master detail page. When I checked the error, it duplicates the master detail function in the control class. The name of the View is different but the function created for the new View page is the same. Here is what it shows:
/**
* Display Master Detail Pages
* @param string $rec_id //master record id
* @return \Illuminate\View\View
*/
function masterDetail($rec_id = null){
return View(“pages.members.detail-pages”, [“masterRecordId” => $rec_id]);
}
/**
* Display Master Detail Pages
* @param string $rec_id //master record id
* @return \Illuminate\View\View
*/
function masterDetail($rec_id = null){
return View(“pages.members.detail-pages”, [“masterRecordId” => $rec_id]);
}
You can easily duplicate this issue if you attempt to duplicate of the “VIew” page that is already set with Mater Detail Relations.
The error message on the page is as follows:
Symfony\Component\ErrorHandler\Error\FatalError
Cannot redeclare App\Http\Controllers\MembersController::masterDetail()