Skip to content

Commit 56ce863

Browse files
authored
Update Lifecycle Hooks Docs (rappasoft#1675)
1 parent bc3d2f3 commit 56ce863

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `laravel-livewire-tables` will be documented in this file
44

5+
## UNRELEASED
6+
### Docs
7+
- Amend Lifecycle Hooks document to use "public" rather than "protected" methods
8+
59
## [v3.2.2] - 2024-02-29
610
### New Features
711
- Add setDefaultPerPage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1671

docs/misc/lifecycle-hooks.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,26 @@ This is called immediately after the Columns are set up
2323
This is called immediately after the query is executed, and is passed the result from the executed query.
2424

2525
## Use in Traits
26-
To use these in a trait, append the Lifecycle Hook with your trait name, e.g.
26+
To use these in a trait, allowing you to easily set defaults across multiple tables, you should ensure that you append the Lifecycle Hook with your trait name, e.g.
27+
28+
You can then add the trait to your tables, allowing you to centralise your defaults, and avoid code duplication.
2729

2830
```php
2931
trait StandardTableMethods
3032
{
3133

32-
protected function configuringStandardTableMethods()
34+
public function configuringStandardTableMethods()
3335
{
3436
// Your standard configure() options go here, anything set here will be over-ridden by the configure() method
37+
// For Example
38+
$this->setColumnSelectDisabled();
3539
}
3640

37-
protected function configuredStandardTableMethods()
41+
public function configuredStandardTableMethods()
3842
{
3943
// Your standard configure() options go here, anything set here will override those set in the configure() method
44+
// For Example
45+
$this->setColumnSelectDisabled();
4046
}
4147

4248
}

0 commit comments

Comments
 (0)