@@ -42,7 +42,6 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable
4242 'cover_image ' ,
4343 'show_toc ' ,
4444 'is_pinned ' ,
45- 'is_sponsored ' ,
4645 'user_id ' ,
4746 'tweet_id ' ,
4847 'submitted_at ' ,
@@ -65,7 +64,6 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable
6564 'sponsored_at ' => 'datetime ' ,
6665 'show_toc ' => 'boolean ' ,
6766 'is_pinned ' => 'boolean ' ,
68- 'is_sponsored ' => 'boolean ' ,
6967 ];
7068
7169 /**
@@ -171,6 +169,16 @@ public function isNotApproved(): bool
171169 return $ this ->approved_at === null ;
172170 }
173171
172+ public function isSponsored (): bool
173+ {
174+ return ! $ this ->isNotSponsored ();
175+ }
176+
177+ public function isNotSponsored (): bool
178+ {
179+ return $ this ->sponsored_at === null ;
180+ }
181+
174182 public function isDeclined (): bool
175183 {
176184 return ! $ this ->isNotDeclined ();
@@ -196,11 +204,6 @@ public function isPinned(): bool
196204 return (bool ) $ this ->is_pinned ;
197205 }
198206
199- public function isSponsored (): bool
200- {
201- return (bool ) $ this ->is_sponsored ;
202- }
203-
204207 public function isNotShared (): bool
205208 {
206209 return $ this ->shared_at === null ;
@@ -283,6 +286,11 @@ public function scopeDeclined(Builder $query): Builder
283286 return $ query ->whereNotNull ('declined_at ' );
284287 }
285288
289+ public function scopeSponsored (Builder $ query ): Builder
290+ {
291+ return $ query ->whereNotNull ('sponsored_at ' );
292+ }
293+
286294 public function scopeNotDeclined (Builder $ query ): Builder
287295 {
288296 return $ query ->whereNull ('declined_at ' );
0 commit comments