generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathHasPageAttributes.php
64 lines (53 loc) · 1.88 KB
/
HasPageAttributes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Statikbe\FilamentFlexibleContentBlocks\Models\Contracts;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
/**
* @property string|null $title
* @property Carbon|null $publishing_begins_at
* @property Carbon|null $publishing_ends_at
*/
interface HasPageAttributes
{
/**
* Returns whether the page is published or visible, based on the begin and end publishing dates.
*/
public function isPublished(): bool;
/**
* Returns whether for the given timestamps the page is published or visible.
*/
public function isPublishedForDates(?Carbon $publishingBeginsAt, ?Carbon $publishingEndsAt): bool;
/**
* Returns whether the page will be published, based on the begin publishing date.
*/
public function willBecomePublished(): bool;
/**
* Returns whether the page will be unpublished, based on the end publishing date.
*/
public function willBecomeUnpublished(): bool;
/**
* Returns whether this page was published in the past and its publication ended.
*/
public function wasUnpublished(): bool;
/**
* Find the published pages based on the publishing dates.
*/
public function scopePublished(Builder $query): Builder;
/**
* Find the unpublished pages based on the publishing dates.
*/
public function scopeUnpublished(Builder $query): Builder;
/**
* Returns the formatted timestamp of the beginning of the publication.
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute<string, never>
*/
public function publishingBeginsAtFormatted(): Attribute;
/**
* Returns the formatted timestamp of the end of the publication.
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute<string, never>
*/
public function publishingEndsAtFormatted(): Attribute;
}