public function chkUserLike(Request $request)
 {
     $like = ResourceLike::where('postId', $request->postId)->where('userId', $request->userId)->first();
     if ($like) {
         return response()->json(true);
     }
     return response()->json(false);
 }
 public function search($input)
 {
     $query = ResourceLike::query();
     $columns = Schema::getColumnListing('resourceLikes');
     $attributes = array();
     foreach ($columns as $attribute) {
         if (isset($input[$attribute]) and !empty($input[$attribute])) {
             $query->where($attribute, $input[$attribute]);
             $attributes[$attribute] = $input[$attribute];
         } else {
             $attributes[$attribute] = null;
         }
     }
     return [$query->get(), $attributes];
 }