Skip to content

Commit 2a8c2fd

Browse files
author
Karl Pierce
committed
Update readme to document guarding attributes
1 parent dff4626 commit 2a8c2fd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
2222
- [Extending the base model](#extending-the-base-model)
2323
- [Soft Deletes](#soft-deletes)
2424
- [Dates](#dates)
25+
- [Guarding attributes](#guarding-attributes)
2526
- [Basic Usage](#basic-usage)
2627
- [MongoDB-specific operators](#mongodb-specific-operators)
2728
- [MongoDB-specific Geo operations](#mongodb-specific-geo-operations)
@@ -240,7 +241,7 @@ use Jenssegers\Mongodb\Auth\User as Authenticatable;
240241

241242
class User extends Authenticatable
242243
{
243-
244+
244245
}
245246
```
246247

@@ -263,6 +264,13 @@ class User extends Model
263264

264265
For more information check [Laravel Docs about Soft Deleting](http://laravel.com/docs/eloquent#soft-deleting).
265266

267+
### Guarding attributes
268+
269+
When choosing between guarding attributes or marking some as fillable, Taylor Otwell prefers the fillable route.
270+
This is in light of [recent security issues described here](https://blog.laravel.com/security-release-laravel-61835-7240).
271+
272+
Keep in mind guarding still works, but you may experience unexpected behavior.
273+
266274
### Dates
267275

268276
Eloquent allows you to work with Carbon or DateTime objects instead of MongoDate objects. Internally, these dates will be converted to MongoDate objects when saved to the database.

0 commit comments

Comments
 (0)