Navigate back to the homepage

Yajra issue after install in laravel

Yajra, Laravel
December 28th, 2020 · 1 min read
Yajra issue after install in laravel

Hello Friends,

Welcome To Infinitbility!

after install yajra getting call_user_func_array() expects parameter 1 to be a valid callback, class ‘Yajra\Datatables\Engines\CollectionEngine’ not found laravel issue

Solution 1

Step 1: delete Datatables config file

delete your Datatables config file located on your config/datatables.php

Step 2: publish yajra DataTablesServiceProvider

publish your yajra DataTablesServiceProvider using below cammand

1php artisan vendor:publish --provider=Yajra\DataTables\DataTablesServiceProvider

Solution 2

Sometimes issue arive when developer not use ->make(true) after using ->addColumn

Same like below code snipest

1public function fetchUsers(){
3 # users list
4 $Users = User::where('status', 'Y')->get();
6 return DataTables::of($Users)
7 ->editColumn('created_at', function ($Users)
8 {
10 $date = date("Y-m-d", strtotime($Users->created_at));
11 return $date;
13 })->addColumn('update', function ($Users)
14 {
15 return $return = '<a class="btn btn-primary" href="'. url('admin/update-user').'/'.encrypt($Users->id).'" >Update</a>';
16 })->addColumn('delete', function ($Users)
17 {
18 return $return = '<button data-id="'. encrypt($Users->id) .'" class="btn delete-user btn-danger">Delete</button>';
19 })->rawColumns(['update', 'delete'])->make(true);

Thanks For Reading…

if you get help, please share a post on your social network

More tutorial form Laravel

  1. Yajra issue after install in laravel
  2. Laravel call function from another class
  3. laravel pagination with customization
  4. How to solve page expired error in laravel for webhooks, ajax, and form
  5. Laravel Model
  6. Laravel Clear cache, config, view and Routes

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

More articles from Infinitbility

Solve warning! Halt on KB and Mouse issue

Solve warning! Halt on KB and Mouse issue

in this article, you get solution for getting halt issue on your PC.

December 27th, 2020 · 1 min read
Solve CORS issue on localhost

Solve CORS issue on localhost

How to Solve getting cors issue in localhost when developing a website.

December 26th, 2020 · 1 min read
© 2020–2021 Infinitbility
Link to $ to $ to $ to $ to $ to $mailto:[email protected]