|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace CSlant\Blog\Core\Models; |
|
4
|
|
|
|
|
5
|
|
|
use AllowDynamicProperties; |
|
6
|
|
|
use Carbon\Carbon; |
|
7
|
|
|
use CSlant\Blog\Core\Models\Base\BasePost; |
|
8
|
|
|
use CSlant\LaravelLike\HasLike; |
|
9
|
|
|
use FriendsOfBotble\Comment\Models\Comment; |
|
|
|
|
|
|
10
|
|
|
use Illuminate\Database\Eloquent\Builder; |
|
11
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne; |
|
12
|
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Class Post |
|
16
|
|
|
* |
|
17
|
|
|
* @package CSlant\Blog\Core\Models |
|
18
|
|
|
* |
|
19
|
|
|
* @property int $id |
|
20
|
|
|
* @property string $name |
|
21
|
|
|
* @property string $description |
|
22
|
|
|
* @property string $content |
|
23
|
|
|
* @property string $status |
|
24
|
|
|
* @property int $author_id |
|
25
|
|
|
* @property string $author_type |
|
26
|
|
|
* @property int $is_featured |
|
27
|
|
|
* @property int $views |
|
28
|
|
|
* @property string $format_type |
|
29
|
|
|
* @property Carbon $created_at |
|
30
|
|
|
* @property Carbon $updated_at |
|
31
|
|
|
* @property Slug $slug |
|
32
|
|
|
* @property string $url |
|
33
|
|
|
* @property Tag[] $tags |
|
34
|
|
|
* @property Category[] $categories |
|
35
|
|
|
* @property Comment[] $comments |
|
36
|
|
|
* @property string $image |
|
37
|
|
|
* @property string $author |
|
38
|
|
|
* |
|
39
|
|
|
* @method static Builder|Post newModelQuery() |
|
40
|
|
|
* @method static Builder|Post newQuery() |
|
41
|
|
|
* @method static Builder|Post query() |
|
42
|
|
|
* @method static Builder|Post first() |
|
43
|
|
|
* @method static Builder|Post find($id) |
|
44
|
|
|
* @method static Builder|Post with($relations) |
|
45
|
|
|
* @method static Builder|Post whereId($value) |
|
46
|
|
|
* @method static Builder|Post whereIn($column, $values) |
|
47
|
|
|
* @method static Builder|Post where($column, $operator = null, $value = null, $boolean = 'and') |
|
48
|
|
|
* @method static Post findOrFail($id) |
|
49
|
|
|
* @method static Post create($data) |
|
50
|
|
|
* |
|
51
|
|
|
* @mixin BasePost |
|
52
|
|
|
*/ |
|
53
|
|
|
#[AllowDynamicProperties] |
|
54
|
|
|
class Post extends BasePost |
|
55
|
|
|
{ |
|
56
|
|
|
use HasLike; |
|
57
|
|
|
|
|
58
|
|
|
public function slug(): HasOne |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->hasOne(Slug::class, 'reference_id', 'id') |
|
61
|
|
|
->where('reference_type', $this->getBaseModel()); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Post has many relationship with the Comment. |
|
66
|
|
|
* |
|
67
|
|
|
* @return MorphMany |
|
68
|
|
|
*/ |
|
69
|
|
|
public function comments(): MorphMany |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->morphMany(\FriendsOfBotble\Comment\Models\Comment::class, 'reference'); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths