I don\'t know what I\'m doing wrong since it works with all the other models in the app. I refreshed and reseeded the database multiple times. The models extend the same abstrac
The reason for the error is the fact, that you're storing a stream resource in pic
field of the serialised object that can't be serialised to JSON.
You can tell Eloquent model to skip selected attributes when they're converted to an array by setting a $hidden
attribute in your model:
class Substrate extends Model {
protected $hidden = ['pic'];
}