Navigate back to the homepage

Yajra issue after install in laravel

Infinitbility
Yajra, Laravel
December 28th, 2020 · 1 min read

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(){
2
3 # users list
4 $Users = User::where('status', 'Y')->get();
5
6 return DataTables::of($Users)
7 ->editColumn('created_at', function ($Users)
8 {
9
10 $date = date("Y-m-d", strtotime($Users->created_at));
11 return $date;
12
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);
20}

Thanks For Reading…

More tutorial form Laravel

Yajra issue after install in laravel

Laravel call function from another class

laravel pagination with customization

How to solve page expired error in laravel for webhooks, ajax, and form

Laravel Model

Laravel Clear cache, config, view and Routes

how to force Laravel to use https in URL and assets

Follow me on Twitter

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.

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]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide

Tutorials

Categories

More articles from Infinitbility

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

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

December 26th, 2020 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]