Skip to content

Commit bcf9d76

Browse files
author
Chris Cho
committed
PRR fixes
1 parent 27635f4 commit bcf9d76

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

docs/eloquent-models/model-class.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Eloquent Model Class
1111
.. meta::
1212
:keywords: php framework, odm, code example, authentication, laravel
1313

14+
.. contents:: On this page
15+
:local:
16+
:backlinks: none
17+
:depth: 2
18+
:class: singlecol
19+
1420
Overview
1521
--------
1622

@@ -25,8 +31,8 @@ to {+odm-short+} models:
2531
- :ref:`laravel-authenticatable-model` shows how to set MongoDB as the
2632
authentication user provider.
2733
- :ref:`laravel-model-customize` explains several model class customizations
28-
- :ref:`laravel-model-pruning` shows how to remove models that you no longer
29-
need periodically.
34+
- :ref:`laravel-model-pruning` shows how to periodically remove models that
35+
you no longer need.
3036

3137
.. _laravel-model-define:
3238

@@ -247,8 +253,8 @@ in the Laravel docs.
247253
Specify Pruning Behavior
248254
------------------------
249255

250-
Eloquent lets you specify criteria to delete model data that you no longer
251-
need automatically. When you schedule or run the ``model:prune`` command,
256+
Eloquent lets you specify criteria to periodically delete model data that you
257+
no longer need. When you schedule or run the ``model:prune`` command,
252258
Laravel calls the ``prunable()`` method on all models that import the
253259
``Prunable`` and ``MassPrunable`` traits to match the models for deletion.
254260

docs/includes/eloquent-models/AuthenticatableUser.php

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

33
namespace App\Models;
44

5+
use MongoDB\Laravel\Auth\User as Authenticatable;
6+
57
class User extends Authenticatable
68
{
79
}

docs/includes/eloquent-models/PlanetMassAssignment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Planet extends Model
88
{
99
/**
10-
* The attributes that are mass assignable.
10+
* The mass assignable attributes.
1111
*
1212
* @var array
1313
*/

docs/includes/eloquent-models/PlanetMassPrune.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ class Planet extends Model
1111

1212
public function prunable()
1313
{
14-
// matches models in which the solar_system field contains a null value
14+
// matches models in which the gravitational_force field contains
15+
// a value greater than 0.5
1516
return static::where('gravitational_force', '>', 0.5);
1617
}
1718
}

docs/includes/eloquent-models/PlanetPrune.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function prunable()
1717

1818
protected function pruning()
1919
{
20-
// delete photo assets of this model
20+
// Cleanup cations such as deleting photo assets of this
21+
// model or printing the Planet 'name' attribute to a log file
2122
}
2223
}

0 commit comments

Comments
 (0)