Hi,
We want to use GoldFishCMS for our hotel. Everything is working fine, only on some of the housekeeping pages, we get the following error:
This is the code from the UserController:
If anyone could help us solve the problem, that would be great.
Regards,
Twan
We want to use GoldFishCMS for our hotel. Everything is working fine, only on some of the housekeeping pages, we get the following error:
"Too few arguments to function App\Http\Controllers\Housekeeping\UserMod\UserController::index(), 1 passed in C:\inetpub\wwwroot\vendor\laravel\framework\src\Illuminate\Routing\Controller.php on line 54 and exactly 2 expected"
This is the code from the UserController:
Code:
<?php
namespace App\Http\Controllers\Housekeeping\UserMod;
use Request;
use Illuminate\Http\Request as Req;
use App\Http\Controllers\Controller;
use App\Helpers\CMS;
use App\Models\User\User as Users;
use App\Models\Hotel\Chatlog;
class UserController extends Controller
{
public function index($user = null, Req $request)
{
if (CMS::fuseRights('moderation_user')) {
if (Request::isMethod('post')) {
if (request()->has('edit')) {
Users::where('username', $user)->update(['motto' => request()->get('motto')]);
if (CMS::fuseRights('moderation_user_admin')) {
Users::where('username', $user)->update([
'rank_id' => request()->get('rank_id'),
'credits' => request()->get('credits')
]);
}
$request->session()->flash('message', "User Saved!");
return redirect()->back();
}
$userdata = Users::where('username', 'LIKE', Request::input('username'))->first();
if (!empty($userdata)) {
return redirect('housekeeping/moderation/lookup/user/' . $userdata->username);
} else {
return redirect('housekeeping/moderation/lookup/user/');
}
}
if (empty($user)) {
$users = Users::orderBy('id', 'DESC')->paginate(15);
return view(
'lookup.user',
[
'group' => 'user',
'users' => $users
]
);
} else {
$userdata = Users::where('username', 'LIKE', $user)->first();
$alt = Users::where('ip_register', $userdata->ip_register)->get();
$chats = Chatlog::whereHas('room')->where('user_from_id', $userdata->id)->orderBy('timestamp', 'DESC')->paginate(25);
\App\Models\CMS\Hk::create([
'user_id' => auth()->user()->id,
'ip' => request()->ip(),
'action' => 'Viewed '.$user,
'timestamp' => time()
]);
return view(
'lookup.user',
[
'group' => 'user',
'user' => $userdata,
'alt' => $alt,
'chats' => $chats
]
);
}
} else {
return redirect('housekeeping/dashboard');
}
}
public function online()
{
$users = Users::orderBy('id', 'DESC')->where('online', '1')->paginate(15);
return view(
'usermod.online',
[
'group' => 'user',
'users' => $users
]
);
}
}
If anyone could help us solve the problem, that would be great.
Regards,
Twan