public function single($lang, $view, $id)
    {
        $classNameArr = explode("\\", get_class($this));
        $className = str_replace("Controller", "", $classNameArr[4]);
        // if we are accessing Post Type check if we are are in category or tags and repair the class name and key for them
        $key = $view;
        if($className === "PostType") {
            if(strpos($key, 'category') !== false) {
                $className = 'Categories';
                // make categorylist to list, categoryupdate to update etc
                $key = str_replace('category', '', $key);
            }else if(strpos($key, 'tag') !== false) {
                // make taglist to list, tagupdate to update etc
                $className = 'Tags';
                $key = str_replace('tag', '', $key);
            }
        }

        $key = ($key == "list" || $key == "posts") ? 'read' : $key;
        // check if user has permissions to access this link
        if($key == 'read') {
            if(!User::hasAccess($className, $key)) {
                return view('errors.permissions', compact('lang', 'view', 'id'));
            }
        }else{
            if(!User::hasAccess($className, $key, $id, true)) {
                return view('errors.permissions', compact('lang', 'view', 'id'));
            }
        }

        return view('content');
    }
public function single($lang, $view, $id)
    {
        $classNameArr = explode("\\", get_class($this));
        $className = str_replace("Controller", "", $classNameArr[4]);
        // if we are accessing Post Type check if we are are in category or tags and repair the class name and key for them
        $key = $view;
        if($className === "PostType") {
            if(strpos($key, 'category') !== false) {
                $className = 'Categories';
                // make categorylist to list, categoryupdate to update etc
                $key = str_replace('category', '', $key);
            }else if(strpos($key, 'tag') !== false) {
                // make taglist to list, tagupdate to update etc
                $className = 'Tags';
                $key = str_replace('tag', '', $key);
            }
        }

        $key = ($key == "list" || $key == "posts") ? 'read' : $key;
        // check if user has permissions to access this link
        if($key == 'read') {
            if(!User::hasAccess($className, $key)) {
                return view('errors.permissions', compact('lang', 'view', 'id'));
            }
        }else{
            if(!User::hasAccess($className, $key, $id, true)) {
                return view('errors.permissions', compact('lang', 'view', 'id'));
            }
        }

        return view('content');
    }
public function single ( $ lang , $ view , $ id ) { $ classNameArr = explode ( "\\" , get_class ( $ this ) ) ; $ className = str_replace ( "Controller" , "" , $ classNameArr [ 4 ] ) ; // if we are accessing Post Type check if we are are in category or tags and repair the class name and key for them $ key = $ view ; if ( $ className === "PostType" ) { if ( strpos ( $ key , 'category' ) !== false ) { $ className = 'Categories' ; // make categorylist to list, categoryupdate to update etc $ key = str_replace ( 'category' , '' , $ key ) ; } else if ( strpos ( $ key , 'tag' ) !== false ) { // make taglist to list, tagupdate to update etc $ className = 'Tags' ; $ key = str_replace ( 'tag' , '' , $ key ) ; } } $ key = ( $ key == "list" || $ key == "posts" ) ? 'read' : $ key ; // check if user has permissions to access this link if ( $ key == 'read' ) { if ( ! User :: hasAccess ( $ className , $ key ) ) { return view ( 'errors.permissions' , compact ( 'lang' , 'view' , 'id' ) ) ; } } else { if ( ! User :: hasAccess ( $ className , $ key , $ id , true ) ) { return view ( 'errors.permissions' , compact ( 'lang' , 'view' , 'id' ) ) ; } } return view ( 'content' ) ; }
Return views for a specific model LIKE update, reset password etc.

@param  string $lang
@param  string $view
@param  int    $id
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
Return views for a specific model LIKE update reset password etc .