https://github.com/yajra/laravel-datatables
did you add into provider?
config/app.php
'providers' => [
...,
Yajra\DataTables\DataTablesServiceProvider::class,
]
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want use yajra datatable in plain php. A installed the yajradatable.
composer require yajra/laravel-datatables
Then I tried this code:
<?php
require "config/config.php";
use Yajra\DataTables\Facades\DataTables;
//Validation is eloquent model
$validations = Validation::query();
echo DataTables::of($validations)->json();
I am getting this error:
Fatal error: Uncaught RuntimeException: A facade root has not been set. in C:\wamp64\www\eloquent\vendor\illuminate\support\Facades\Facade.php on line 258
Please or to participate in this conversation.