php - Infyom laravel generator not displaying datatables data
Get the solution ↓↓↓I know this is a common issue but I have tried returning my data asjson
but I cannot seem to display data on my datatables since yesterday. I am running Laravel 8.55.
User
migration
$table->bigIncrements('id');
$table->string('firstName')->nullable();
$table->string('lastName')->nullable();
$table->string('mobile')->unique()->nullable();
$table->string('email')->unique()->nullable();
UserDataTable
public function query(User $model)
{
return $model->newQuery()
->orderByDesc('users.id');
}
protected function getColumns()
{
return [
'firstName',
'lastName',
'mobile',
'email',
];
}
UserController
public function index(UserDataTable $userDataTable)
{
return $userDataTable->render('users.index');
}
public function show($id)
{
$user = $this->userRepository->find($id);
if (empty($user)) {
Flash::error('User not found');
return redirect(route('users.index'));
}
return response()->json($user);
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: object not found by the @paramconverter annotation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.