Skip to content

Commit 772d5f8

Browse files
committed
Add guarded property to all models
You will need to specify either a fillable or guarded property on your model class. These properties are required because all Eloquent models are protected against mass assignment vulnerabilities by default.
1 parent 5af78ff commit 772d5f8

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

app/Models/Category.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
class Category extends Model
99
{
1010
use HasFactory;
11+
12+
protected $guarded = [];
1113
}

app/Models/Order.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
class Order extends Model
99
{
1010
use HasFactory;
11+
12+
protected $guarded = [];
1113
}

app/Models/Product.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
class Product extends Model
99
{
1010
use HasFactory;
11+
12+
protected $guarded = [];
1113
}

0 commit comments

Comments
 (0)