Adding prunable and separating accessors and mutators

This commit is contained in:
Brian 2021-07-15 13:08:41 -06:00
parent 6488488c2f
commit b179075074
Signed by: brian
GPG Key ID: DE1A5390A3B84CD8

View File

@ -1,5 +1,6 @@
<snippet> <snippet>
<content><![CDATA[ <content><![CDATA[
use Prunable;
protected \$table = ''; protected \$table = '';
@ -39,11 +40,38 @@ protected \$dispatchesEvents = [];
| |
*/ */
/**
* Get the prunable model query.
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function prunable(): Builder
{
return static::where('created_at', '<=', now()->subMonth());
}
/**
* Prepare the model for pruning.
*
* @return void
*/
protected function pruning(): void
{
//
}
/*
|--------------------------------------------------------------------------
| Accessors
|--------------------------------------------------------------------------
|
*/
// //
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Accessors and Mutators | Mutators
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
*/ */