File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -561,6 +561,8 @@ public function includes(): Relation
561561 * ])
562562 * # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'
563563 *
564+ * @throws ValidationsArgumentError If you pass in a Relation. Relation::and() supports relations
565+ *
564566 * @return Relation<TModel>
565567 */
566568 public function where (): Relation
Original file line number Diff line number Diff line change @@ -115,6 +115,12 @@ public function testAnd()
115115 $ this ->assertEquals ('Bill Clinton ' , $ model ->name );
116116 }
117117
118+ public function testAndRelationThrowsError ()
119+ {
120+ $ this ->expectException (ValidationsArgumentError::class);
121+ Author::where (Author::where ("mixedCaseField = 'Bill' " ));
122+ }
123+
118124 public function testReverseOrder ()
119125 {
120126 $ relation = Author::where (['mixedCaseField ' => 'Bill ' ]);
You can’t perform that action at this time.
0 commit comments