File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 2
2
composer.lock
3
3
docs
4
4
vendor
5
+ .idea
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ This package automatically inserts/updates an audit log on your table on who cre
14
14
composer require yajra/laravel-auditable
15
15
```
16
16
17
+ ## Publish config file
18
+
19
+ If you want to modify the ` withDefault ` option on auditable columns, you may publish the config file.
20
+
21
+ ``` bash
22
+ php artisan vendor:publish --tag=auditable
23
+ ```
24
+
17
25
## Usage
18
26
19
27
Update your model's migration and add ` created_by ` and ` updated_by ` field using the ` auditable() ` blueprint macro.
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ public static function bootAuditableWithDeletesTrait()
26
26
*/
27
27
public function deleter ()
28
28
{
29
- return $ this ->belongsTo ($ this ->getUserClass (), $ this ->getDeletedByColumn ())->withDefault ();
29
+ return $ this ->belongsTo ($ this ->getUserClass (), $ this ->getDeletedByColumn ())
30
+ ->withDefault (config ('auditable.defaults.deleter ' ));
30
31
}
31
32
32
33
/**
Original file line number Diff line number Diff line change 11
11
'name ' => '' ,
12
12
// add updater default values if not set
13
13
],
14
+
15
+ 'deleter ' => [
16
+ 'name ' => '' ,
17
+ // add deleter default values if not set
18
+ ],
14
19
],
15
20
];
You can’t perform that action at this time.
0 commit comments