Skip to content

Conversation

@OzanKurt
Copy link
Contributor

Usage:

$builder->editColumn('permissions_display', [
    'admin.roles.data-table.permissions-display', ['groupedPermissions' => $groupedPermissions],
]);

I couldn't decide if I should make it an associative array or not, but this seems simple enough. If the $content is an array get the split it and add the second value to its view data.

Extremely straightforward code for mini extra function.

if (is_array($content)) {
    [$view, $viewData] = $content;

    return static::compileBlade($view, static::getMixedValue($data, $param)  + $viewData);
}

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
13.7% 13.7% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@OzanKurt
Copy link
Contributor Author

@yajra Any luck about this? 😄

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 and does not break any tests. It would be nice if we could also document this in https://github.com/yajra/laravel-datatables-docs/blob/10.0/edit-column.md. Thanks!

@yajra yajra changed the title Ability to pass static data to a blade render feat: Ability to pass static data to a blade render Sep 29, 2023
@yajra yajra merged commit 39923f8 into yajra:master Sep 29, 2023
@yajra
Copy link
Owner

yajra commented Sep 29, 2023

Released on v10.9.0 🚀 Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants