File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ function () use ($plugins): array {
3333 $ plugins ,
3434 fn (EloquentBuilder $ query ) => $ query ->whereKey ($ plugins ),
3535 )
36+ ->where (
37+ fn (EloquentBuilder $ query ) => $ query ->whereNull ('is_draft ' )->orWhere ('is_draft ' , false )
38+ )
3639 ->orderByDesc ('publish_date ' )
3740 ->with (['author ' ])
3841 ->get ()
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class Plugin extends Model implements Starrable
2727 'has_translations ' => 'boolean ' ,
2828 'is_lemon_squeezy_embedded ' => 'boolean ' ,
2929 'is_presale ' => 'boolean ' ,
30+ 'is_draft ' => 'boolean ' ,
3031 'versions ' => 'array ' ,
3132 'publish_date ' => 'date ' ,
3233 'docs_urls ' => 'array ' ,
@@ -48,6 +49,7 @@ public static function schema(Blueprint $table)
4849 $ table ->string ('image ' )->nullable ();
4950 $ table ->boolean ('is_lemon_squeezy_embedded ' )->nullable ()->default (false );
5051 $ table ->boolean ('is_presale ' )->nullable ()->default (false );
52+ $ table ->boolean ('is_draft ' )->nullable ()->default (false );
5153 $ table ->string ('name ' );
5254 $ table ->string ('price ' )->nullable ();
5355 $ table ->string ('slug ' );
@@ -106,6 +108,11 @@ public function isFree(): bool
106108 return blank ($ this ->price ) && blank ($ this ->anystack_id );
107109 }
108110
111+ public function isDraft (): bool
112+ {
113+ return (bool ) $ this ->is_draft ;
114+ }
115+
109116 public function getCheckoutUrl (): ?string
110117 {
111118 if (filled ($ this ->checkout_url )) {
You can’t perform that action at this time.
0 commit comments