title: Laravel eloquent: Object of class Closure could not be converted to string join query
body: <p>I am trying to get all the vehicles that dont have a booking for the selected dates:</p>
  
  <pre><code> $bookings = Booking::all();
   $vehicles = Vehicle::all();
  
   $selectedStart = Carbon::createFromFormat('d/m/Y H:i',  $request['start']);
   $selectedEnd =  Carbon::createFromFormat('d/m/Y H:i',  $request['end']);
  
  
   $availableVehicles = $vehicles-&gt;join('bookings', function ($join){
          $join-&gt;on('vehicles.id', '=', 'bookings.vehicle_id')
              -&gt;where([
                      ['bookings.start', '&lt;',$selectedStart],
                      ['bookings.end', '&lt;', $selectedStart]
                  ])-&gt;orWhere([
                      ['bookings.start', '&gt;',$selectedEnd],
                      ['bookings.end', '&gt;', $selectedEnd]
                  ]);
    })-&gt;get();
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>Object of class Closure could not be converted to string</p>
  </blockquote>