skip to Main Content

In my project every other pages works fine but one page giving me error. I tried to fixed it but I couldn’t. I used wamp server, mysql, php laravel framework. the url is correct. please help me to fix this error.

Laravel version 7.0
PHP Version 7.2.10

Web php

Route::get('WebSiteManagement', "WebSiteManagementController@ViewPage")->middleware('CheckUserPermission');

Middleware

class CheckUserPermission
{
    /**
     * Handle an incoming request.
     *
     * @param  IlluminateHttpRequest $request
     * @param  Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $currentPath = $request->path();

        $pageId = DB::table('userpagemaster')
            ->where('userPermissionName', $currentPath)
            ->first();
            
        $pageID = $pageId->userPageId;
        $userGroupId = Session::get('userGroup');

        if ($userGroupId != null) {
            $menuPermissions = DB::table('userpermissionmaster')
                ->where('userGroupId', $userGroupId)
                ->get()
                ->pluck('userPageId');

            Session::put('menuPermissions', $menuPermissions);

            $pagePermission = DB::table('userpermissionmaster')
                ->where('userGroupId', $userGroupId)
                ->where('userPageId', $pageID)
                ->first();

            if ($pagePermission) {

                if ($pagePermission->readOnly != '') {
                    $pagePermissionReadOnlyCheck = $pagePermission->readOnly;
                } else {
                    $pagePermissionReadOnlyCheck = 'null';
                }

                if ($pagePermission->readWrite != '') {
                    $pagePermissionReadWriteCheck = $pagePermission->readWrite;
                } else {
                    $pagePermissionReadWriteCheck = 'null';
                }

                $request->attributes->add(['readOnly' => $pagePermissionReadOnlyCheck, 'readWrite' => $pagePermissionReadWriteCheck]);

                return $next($request);
            } else {

                return redirect('403Page');
            }
        } else {

            return redirect('/');
        }
    }

Controller

public function ViewPage()
    {
        $readOnly = Request::get('readOnly');
        $readWrite = Request::get('readWrite');

        return view('websiteManagement')->with(['readOnly' => $readOnly, 'readWrite' => $readWrite]);
    }

Error
enter image description here

Thank You!

2

Answers


  1. Chosen as BEST ANSWER

    It turns out, I was using aws s3 bucket url and configuration are wrong!


  2. The error message is that your requested URL does not exist. Here are only some ideas:

    1. Check to see if there is ssl authentication from time to time, http and https access configuration items in guzzle
    2. Is the URL parameter address correct
    3. Is the permission setting correct
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search