File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,13 @@ public function canBeOrdered(): bool
64
64
&& ($ this ->hasStock () || $ this ->availability == BookAvailability::AvailableOnDemand);
65
65
}
66
66
67
+ public function getAvailabilityLabelAttribute (): ?string
68
+ {
69
+ return $ this ->hasStock () && $ this ->availability != BookAvailability::Forthcoming
70
+ ? null
71
+ : $ this ->availability ->getLabel ();
72
+ }
73
+
67
74
public function visual (string $ size ): string
68
75
{
69
76
$ url = $ this ->visuals [$ size ];
@@ -75,11 +82,6 @@ public function visual(string $size): string
75
82
return $ url ;
76
83
}
77
84
78
- public function jsonSerialize (): array
79
- {
80
- return (new BookJsonResource ($ this ))->jsonSerialize ();
81
- }
82
-
83
85
public function resolveRouteBinding ($ value , $ field = null )
84
86
{
85
87
if (is_array ($ value )) {
You can’t perform that action at this time.
0 commit comments