'integer', 'likes' => 'integer', 'size' => 'integer', 'uploader' => 'integer', 'public' => 'integer', ]; public function setPrivacy($public) { $this->public = $public ? "1" : "0"; return $this->save(); } public function scopeLike($query, $field, $value) { return $query->where($field, 'LIKE', "%$value%"); } }