Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Macroable DataTable Base Class #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
yajra merged 1 commit into yajra:master from ejgandelaberon:master
Feb 26, 2025
Merged

Conversation

@ejgandelaberon
Copy link
Contributor

@ejgandelaberon ejgandelaberon commented Feb 20, 2025

This PR aims to give Yajra\DataTables\Services\DataTable base class more flexibility by adding the Illuminate\Support\Traits\Macroable trait which allows us to register custom methods.

class AppServiceProvider extends ServiceProvider
{
 public function boot(): void
 {
 Yajra\DataTables\Services\DataTable::macro('foo', fn (): string => 'bar');
 }
}
$dataTable = new class extends Yajra\DataTables\Services\DataTable {}
$dataTable->foo(); // returns 'bar'

Copy link

Copy link
Owner

@yajra yajra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will include in v12 release. Thanks!

@yajra yajra changed the title (削除) Macroable DataTable Base Class (削除ここまで) (追記) feat: Macroable DataTable Base Class (追記ここまで) Feb 26, 2025
@yajra yajra merged commit c7090c6 into yajra:master Feb 26, 2025
7 checks passed
Copy link
Owner

yajra commented Feb 26, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yajra yajra yajra approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /