Reputation: 19678
I'm using a database with images as blob data and I want to ignore the "image" field of the table/model by default but be able to use the field later. ¿Is this possible?.
Upvotes: 1
Views: 3060
Reputation: 146201
You can use this in your model, for example User
model:
protected $hidden = array('image');
If you use this:
$model = User::find(1);
dd($model->toArray());
You'll not see the image
field but if you use this:
dd($model->image);
Then you'll see that.
Upvotes: 2