Skip to content
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

feat: Ability to pass static data to a blade render #3067

Merged
merged 1 commit into from
Sep 29, 2023

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);
}

@sonarcloud
Copy link

sonarcloud bot commented Sep 18, 2023

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
4 of 5 checks passed
@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