When I go to a specific url on my local machine using XAMPP
In the production server
Locally the request has no response data available
There are other pages which use the same headers and footer as this one and they load fine both locally and in the production server.
Here’s what the edit looks like
/**
* Show the form for editing the specified resource.
*
* @param AppOrganizationUser $org_user
* @return IlluminateHttpResponse
*/
public function edit(Request $request, OrganizationUser $org_user, Organization $model1, User $model2)
{
// Check if user is admin
$auth_user = Auth::user();
$path = $request->path();
$organization_id = (int)explode('/', $path)[1];
$user_id = (int)explode('/', $path)[3];
//dd($org_user->load('user')->load('organization'));
if($auth_user->isAdmin()) {
return view('organizations.users.edit', [
'org_user' => $org_user->load('user')->load('organization')->where('id', $user_id)->first(),
'organizations' => $model1::where('id', $organization_id)->get(['id', 'name']),
'users' => $model2->get(['id', 'name'])
]);
} else {
abort(404);
}
}
What have I tried so far
- Clear configuration cache
php artisan config:clear
- Clearing route cache
php artisan route:clear
- Clearing view cache
php artisan view:clear
- Clearing event cache
php artisan event:clear
- Clearing application cache
php artisan cache:clear
- Clearing all cache
php artisan optimize:clear
- Clearing content from Composer’s cache
composer dump-autoload
- Clearing NPM cache
npm cache clean --force
-
Use a different browser (tested both in Chrome and Firefox).
-
Restart Apache through the XAMPP console.
-
Restart the computer.
Edit
Upon request, here’s the .htaccess present in the /public folder
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
2
Answers
The way I've managed to make it work was to disable XAMPP's Apache and run instead
Now I'm able to use it just fine.
Try this, change your httacces file: