Commit 19e2481 1 parent bb5ed56 commit 19e2481 Copy full SHA for 19e2481
File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace ModelBuilder ;
4
4
5
5
use App \Post ;
6
+ use App \PostBuilder ;
6
7
use App \Team ;
7
8
use Illuminate \Database \Eloquent \Builder ;
8
9
use Illuminate \Database \Eloquent \Model ;
9
10
use Illuminate \Support \Facades \DB ;
10
11
12
+ use function PHPStan \Testing \assertType ;
13
+
11
14
class User extends Model
12
15
{
13
16
/** @return Builder<static> */
@@ -39,4 +42,16 @@ function test(): void
39
42
40
43
/** @see https://github.com/larastan/larastan/issues/1952 */
41
44
Team::query ()->where ('name ' , 'Team A ' )->orderBy ('name ' )->get ();
45
+
46
+ \App \User::query ()->whereHas ('posts ' , function ($ query ) {
47
+ assertType ('App\PostBuilder<App\Post> ' , $ query );
48
+ })->get ();
49
+
50
+ \App \User::query ()->whereHas ('posts ' , function (Builder $ query ) {
51
+ assertType ('App\PostBuilder<App\Post> ' , $ query );
52
+ })->get ();
53
+
54
+ \App \User::query ()->whereHas ('posts ' , function (PostBuilder $ query ) {
55
+ assertType ('App\PostBuilder<App\Post> ' , $ query );
56
+ })->get ();
42
57
}
You can’t perform that action at this time.
0 commit comments