Adding prunable and separating accessors and mutators
This commit is contained in:
parent
6488488c2f
commit
b179075074
@ -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
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user