Created
February 13, 2020 13:16
-
-
Save rajucs/cea745d625be736e1ac0b19eba48f1aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Illuminate\Database\Eloquent\MassAssignmentException | |
Add [_token] to fillable property to allow mass assignment on [App\Model\Customer]. | |
Solution: | |
you need to fill the model | |
From: | |
namespace App\Model; | |
use Illuminate\Database\Eloquent\Model; | |
class Customer extends Model | |
{ | |
protected $table = 'customers'; | |
protected $fillable = [ | |
]; | |
} | |
To: | |
namespace App\Model; | |
use Illuminate\Database\Eloquent\Model; | |
class Customer extends Model | |
{ | |
protected $table = 'customers'; | |
protected $fillable = [ | |
'name', | |
'email', | |
'number', | |
'address', | |
'postcode', | |
'upazilla_id', | |
'district_id', | |
'division_id', | |
'country', | |
'created_by_id' | |
]; | |
} |
Você também me salvou S2.
My solution was different, I added protected $guarded = ['id'];
in the first line of the model
My solution was different, I added
protected $guarded = ['id'];
in the first line of the model
Same worked for me
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
u save me <3