title: how to check count of likes and dislike for post for rating sysytem
body: <p>i am making an system to check count of likes and dislike if like count is more then dislike count then it gives true 
  but i am getting an error </p>
  
  <pre><code>// if (Files::withCount('likes') &gt;= Files::withCount('dislike')) {
        //     return response()-&gt;json(['true']);
  
        // }elseif (Files::withCount('dislike') &gt;= Files::withCount('like')) {
        //             return response()-&gt;json(['false']);
        // }else{
        //             return response()-&gt;json(['error'=&gt;'somethingwenrwrng']);
  
        // }
  
    //   if( DB::table('files')-&gt;select('files_id')
    //       -&gt;join('likes','files_id.files_id','=','files_id') &gt; DB::table('files')-&gt;select('id')
    //       -&gt;join('dislike','files_id.files_id','=','files_id') ){
    //     return response()-&gt;json(['true']);
    // }else {
    //   return response()-&gt;json(['error'=&gt;'somethingwenrwrng']);
    // }
      $file = Files::find($id);
       if($file -&gt;likes-&gt;count() &gt; $file -&gt;dislike-&gt;count() ){
        return response()-&gt;json(['true']);
      }else{
        return response()-&gt;json(['error'=&gt;'somethingwenrwrng']);
      }
  </code></pre>
  
  <p>i have tried different method to check but getting an error </p>