Closed KhaledLela closed 1 year ago
ScormModel::whereOriginFile()
From Laravel doc despite old version still supported. Dynamic Where Clauses You may even use "dynamic" where statements to fluently build where statements using magic methods:
$admin = DB::table('users')->whereId(1)->first(); $john = DB::table('users') ->whereIdAndEmail(2, 'john@doe.com') ->first(); $jane = DB::table('users') ->whereNameOrAge('Jane', 22) ->first();
Update
/** * Handle dynamic method calls into the method. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public function __call($method, $parameters) { if (static::hasMacro($method)) { return $this->macroCall($method, $parameters); } if (str_starts_with($method, 'where')) { return $this->dynamicWhere($method, $parameters); } static::throwBadMethodCallException($method); }
Not related to library but i added as searchable reference it may help others needs clean, short and readable dynamic where style.
Thanks!
Update