title: How can I search with belongsto laravel?
body: <p>My query to search for a username in a store listing is as follows:</p>
  
  <pre><code>$data = Store::join('users AS b', 'b.id', '=', 'stores.user_id')
               -&gt;where('b.name', 'like', '%hazard%')
               -&gt;paginate();
  </code></pre>
  
  <p>It works. But I use join to do it.</p>
  
  <p>How can I do it using belongto?</p>
  
  <p>My store model is like this :</p>
  
  <p>
  
  <pre><code>class Store extends Model
  {   
      protected $fillable = ['name', 'user_id', ...];
      public function user()
      {
          return $this-&gt;belongsTo(User::class,'user_id', 'id');
      }
      ...
  }
  </code></pre>