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

doc: correct hidden() to visible() method #2441

Merged
merged 1 commit into from
May 16, 2022

Conversation

Michael-HEIW
Copy link
Contributor

  • the hidden() method was incorrect:
// was:
->hidden(fn (Post $record): bool => auth()->user()->can('update', $record))
// should be:
->hidden(fn (Post $record): bool => ! auth()->user()->can('update', $record))
  • I think the visible() method is easier to read, in this example.
// now:
->visible(fn (Post $record): bool => auth()->user()->can('update', $record))

- the `hidden()` method was incorrect:

```php
// was:
->hidden(fn (Post $record): bool => auth()->user()->can('update', $record))
// should be:
->hidden(fn (Post $record): bool => ! auth()->user()->can('update', $record))
```

I think the `visible()` method is easier to read, in this example.

```php
// now:
->visible(fn (Post $record): bool => auth()->user()->can('update', $record))
```
@danharrin danharrin added bug Something isn't working documentation Improvements or additions to documentation labels May 16, 2022
@danharrin danharrin merged commit e8950ac into filamentphp:2.x May 16, 2022
@danharrin
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants