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

Allow multiple parameter methods when extending columns #34

Merged

Conversation

intrepidws
Copy link
Contributor

Previously it was not possible to use multiple parameter methods when extending columns. This PR allows you to use an array to provide multiple parameters to method, like so:

<?php

return [

    'audits_extend' => [
       'created_at' => [
           'class' => \Filament\Tables\Columns\TextColumn::class,
           'methods' => [
               'sortable',
               'date' => ['Y-m-d H:i:s', 'America/New_York'],
            ],
        ],
    ]

];

Copy link

what-the-diff bot commented Dec 10, 2024

PR Summary

  • Update to README.md
    The README.md file has been updated. It now includes information that methods with two or more parameters can be specified using an array format. This change makes it easier for developers to understand the newer, flexible way of specifying parameters.

  • Inclusion of Code Snippet
    A code snippet has been added to README.md to provide a practical demonstration of how the new array configuration can be used with audits_extend. This improvement caters towards a hands-on learning experience for developers allowing them to understand this feature better.

  • Modification to AuditsRelationManager.php
    The AuditsRelationManager.php file has been modified. New changes include updating the way parameters are passed to a method. Instead of the older way, the spread operator (...) with Arr::map() is now implemented. This update allows for improved and more efficient handling of method parameters.

@intrepidws
Copy link
Contributor Author

Just realized I had written map instead of wrap - that's fixed now.

@swilla swilla requested a review from andreia December 11, 2024 01:16
@andreia andreia merged commit ddfc215 into TappNetwork:main Dec 12, 2024
@andreia
Copy link
Member

andreia commented Dec 12, 2024

That's great, thank you @intrepidws! :)

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