Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Datatables Oracle

Laravel Datatables Oracle Laravel Package

yajra/laravel-datatables-oracle

Laravel package for DataTables server-side processing. Turn Eloquent queries, Fluent Query Builder queries, or Collections into AJAX-ready JSON with a single line via the DataTables facade. Filtering, searching, sorting, and pagination are handled for you.

View on GitHub
Deep Wiki
Context7

yajra/laravel-datatables-oracle is a Laravel package that handles the server-side processing required by the DataTables jQuery plugin via its AJAX option. Instead of loading entire result sets into the browser, it lets you paginate, search, and sort data efficiently on the server using Eloquent ORM, the Fluent Query Builder, or plain Collections.

A simple facade call returns the JSON response DataTables expects, so integration stays minimal:

return DataTables::eloquent(User::query())->toJson();
return DataTables::query(DB::table('users'))->toJson();
return DataTables::collection(User::all())->toJson();

Key features

  • Unified API for Eloquent, Query Builder, and Collection data sources
  • Built-in filtering, sorting, and pagination driven by client requests
  • Searchable and orderable custom columns, relations, and raw expressions
  • Support for aggregated/grouped queries and nested relationships
  • Blade/HTML builders and export helpers for tables and print views
Frequently asked questions about Laravel Datatables Oracle
How do I install yajra/laravel-datatables-oracle in Laravel?
Install it with composer require yajra/laravel-datatables-oracle. Laravel 5.5 and later use package auto-discovery, so no manual service provider registration is normally needed. Optionally publish the config with php artisan vendor:publish --tag=datatables if you need to override defaults. For the v13 line, confirm your app meets PHP 8.3+ and Laravel 12 or 13 before installing.
Which Laravel and PHP versions does yajra/laravel-datatables support?
The v13 line requires PHP 8.3 or newer and Laravel 12 or 13. The package major version tracks the Laravel major version, so older applications are pinned to ^12 or earlier and should be treated as a separate upgrade track. Plan for a package upgrade alongside every Laravel major upgrade.
What is the difference between DataTables::eloquent(), DataTables::query(), and DataTables::collection()?
Use DataTables::eloquent() for Eloquent models where you want relationships, scopes, and model events. Use DataTables::query() with the fluent query builder for high-volume reporting or complex joins where raw query control matters. Use DataTables::collection() for bounded, computed, or non-database datasets, since it loads data into memory before filtering and paging.
Does yajra/laravel-datatables handle filtering, sorting, and pagination automatically?
Yes. The package reads the DataTables AJAX payload (draw, start, length, search, order, and columns) and applies filtering, sorting, and pagination before returning the expected JSON envelope. You define the base query or collection and column mappings, and the package manages the request-driven behavior. It does not replace your application's authorization or validation logic.
How do I secure column names and ordering in yajra/laravel-datatables?
Treat column names and order clauses from the browser as untrusted input and never pass raw request keys into the query builder. Use an explicit allowlist for searchable and orderable columns, enforce per-column authorization in your controller or policy layer, and pin patch versions of the package. Recent releases hardened this area, including an allowlist for column validation in 13.1.1 and a fix for SQL injection in orderByNullsLast in 13.1.0, but the package should still be treated as security-sensitive.
Can I use yajra/laravel-datatables with Eloquent relationships and eager loading?
The Eloquent driver supports eager loading with with() and can search and sort related columns when you define them explicitly in the column configuration. Deep joins and complex relation filtering can become harder to express and may perform better with the query builder driver. Choose the driver per screen based on join depth and expected row counts.
Does yajra/laravel-datatables support inline editing and row CRUD?
No. The MIT-licensed core package handles read-only server-side processing and returns JSON for display. Inline editing and row CRUD require DataTables Editor, which is a separate commercial license and a procurement decision rather than a Composer dependency. Keep editing out of scope unless that license and budget are approved.
How do I test a DataTables endpoint built with yajra/laravel-datatables?
Write feature tests that call your DataTables route with the AJAX parameters the frontend would send, including draw, start, length, columns, search, and order. Assert the JSON envelope contains draw, recordsTotal, recordsFiltered, and data, and add cases for filtering, sorting, and unauthorized access. Use RefreshDatabase and seeded fixtures so pagination and search assertions are deterministic.
Is yajra/laravel-datatables a good fit for APIs or SPAs, and what alternatives should I consider?
It is a poor fit for API-first applications, SPAs, mobile clients, or Livewire and Inertia screens that need a typed JSON contract independent of the DataTables request schema. It fits classic Laravel MVC with Blade and jQuery DataTables, especially internal admin and back-office tooling. If you need a different frontend contract, consider building explicit API resources or using a table component that does not depend on DataTables AJAX parameters rather than forcing this package into that role.
Who maintains yajra/laravel-datatables and what are the production risks?
The package is effectively maintained by a single primary maintainer with an informal Gitter support channel and no vendor SLA, though it has healthy adoption at roughly 4.9k GitHub stars. The MIT license covers the core, but production use should include pinned patch versions, routine security review, and a dependency-graph check because the reported dependents signal is anomalous due to the meta-package split. Budget for package upgrades in lockstep with Laravel majors.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections