asadali007's avatar

ChunkById

Hello, everyone i am using ChunkById to update certain record but some error have come do you know what is the error how to solve this is my code

/chunkById
        Flight::where('lastname', 'danel') 
             ->chunkById(200, function ($flights) {
        
                $flights->each->update(['lastname' => 'good']);

            
        }, $column = 'id');

this error have come

Illuminate\Database\Eloquent\MassAssignmentException
Add [lastname] to fillable property to allow mass assignment on [App\Models\Flight].
http://127.0.0.1:8888/dataa
0 likes
4 replies
usmanzahid's avatar

Add the following to the Flight Model file: protected $guarded = [];

Please or to participate in this conversation.