-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e2323e
commit fbd9edd
Showing
10 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
includes: | ||
- ./vendor/larastan/larastan/extension.neon | ||
parameters: | ||
level: 9 | ||
paths: | ||
- types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\BelongsToThrough\Types\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Znck\Eloquent\Traits\BelongsToThrough; | ||
|
||
class Comment extends Model | ||
{ | ||
use BelongsToThrough; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\BelongsToThrough\Types\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Country extends Model | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\BelongsToThrough\Types\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Post extends Model | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\BelongsToThrough\Types\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class User extends Model | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\BelongsToThrough\Types; | ||
|
||
use Staudenmeir\BelongsToThrough\Types\Models\Comment; | ||
use Staudenmeir\BelongsToThrough\Types\Models\Country; | ||
use Staudenmeir\BelongsToThrough\Types\Models\Post; | ||
use Staudenmeir\BelongsToThrough\Types\Models\User; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
function test(Comment $comment): void | ||
{ | ||
assertType( | ||
'Znck\Eloquent\Relations\BelongsToThrough<Staudenmeir\BelongsToThrough\Types\Models\Country, Staudenmeir\BelongsToThrough\Types\Models\Comment>', | ||
$comment->belongsToThrough(Country::class, [User::class, Post::class]) | ||
); | ||
} |