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 \App\OrganizationUser $org_user
* @return \Illuminate\Http\Response
*/
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
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan event:clear
php artisan cache:clear
php artisan optimize:clear
composer dump-autoload
npm cache clean --force
Use a different browser (tested both in Chrome and Firefox).
Restart Apache through the XAMPP console.
Restart the computer.
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>
The way I've managed to make it work was to disable XAMPP's Apache and run instead
php artisan serve
Now I'm able to use it just fine.