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]);
}
Thank You!
2
Answers
It turns out, I was using aws s3 bucket url and configuration are wrong!
The error message is that your requested URL does not exist. Here are only some ideas: