WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b23c861

Browse files
authored
Merge pull request #4 from chrisrhymes/fix/add-model-properties
Add model properties
2 parents 0c98a5b + 45efe8a commit b23c861

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/Models/BrokenLink.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44

55
use Illuminate\Database\Eloquent\Factories\HasFactory;
66
use Illuminate\Database\Eloquent\Model;
7+
use Illuminate\Database\Eloquent\Relations\MorphTo;
78

9+
/**
10+
* ChrisRhymes\LinkChecker\Models\BrokenLink
11+
*
12+
* @property int $id
13+
* @property int $linkable_id
14+
* @property string $linkable_type
15+
* @property string $broken_link
16+
* @property string $link_text
17+
* @property string $exception_message
18+
* @property \Illuminate\Support\Carbon|null $created_at
19+
* @property \Illuminate\Support\Carbon|null $updated_at
20+
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent|null $linkable
21+
*/
822
class BrokenLink extends Model
923
{
1024
use HasFactory;
@@ -17,7 +31,7 @@ class BrokenLink extends Model
1731
'exception_message',
1832
];
1933

20-
public function linkable()
34+
public function linkable(): MorphTo
2135
{
2236
return $this->morphTo();
2337
}

tests/Models/Post.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
use Illuminate\Database\Eloquent\Factories\HasFactory;
88
use Illuminate\Database\Eloquent\Model;
99

10+
/**
11+
* ChrisRhymes\LinkChecker\Test\Models\Post
12+
*
13+
* @property int $id
14+
* @property string $title
15+
* @property string $content
16+
*/
1017
class Post extends Model
1118
{
1219
use HasFactory, HasBrokenLinks;

0 commit comments

Comments
 (0)