Skip to content

Instantly share code, notes, and snippets.

View DengoPHP's full-sized avatar

Dengo DengoPHP

View GitHub Profile
@DengoPHP
DengoPHP / subselect.php
Last active September 8, 2021 06:51
Laravel Eloquent with Subselect and Advanced Where
<?php
DB::table('rooms')
->whereNotIn('room_id', function($query)
{
$query->select('room_id')
->from(with(new Booking)->getTable())
->where(function($query)
{
$query->where('time_out', '<', '2012-09-14T18:00')
->orWhere('time_in', '>', '2012-09-21T09:00');
<?php
class ThisClassHasAVeryLongClassNameAndAlsoCanBeCalledStatcly {
public function __construct() {}
public function speak($a) {
return call_user_func($a, $this->getOtherClass());
}