Skip to content

Commit

Permalink
Deploying to gh-pages from @ 475373c 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Sep 16, 2024
1 parent 1ad80fe commit c126664
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 33 deletions.
9 changes: 4 additions & 5 deletions en/docs/rows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,20 +405,19 @@ <h1 class="me-3">Rows</h1>

class Appointment extends Rows
{

/**
* Define the fields for the appointment form.
*
* @return Field[]
*/
protected function fields(): array
{
return [
DateTimer::make()
-&gt;name('appointment_time')
DateTimer::make('appointment_time')
-&gt;required()
-&gt;title('Time'),

TextArea::make()
-&gt;name('doctor_notes')
TextArea::make('doctor_notes')
-&gt;rows(10)
-&gt;required()
-&gt;title('Doctor notes')
Expand Down
41 changes: 13 additions & 28 deletions en/docs/table/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,47 +574,32 @@ <h2><a href='#using-components' id='using-components'>Using Components</a></h2>

class OrderShortInformation extends Component
{
/**
* @var Order
*/
public $order;
public function __construct(
public readonly Order $order
) {}

/**
* Create the component instance.
* Get the status description.
*
* @param Order $order
* @return void
*/
public function __construct(Order $order)
{
$this-&gt;order = $order;
}

/**
* @return string
*/
public function status()
public function status(): string
{
$descriptions = [
1 =&gt; __('In the process'),
2 =&gt; __('Paid'),
3 =&gt; __('Cancellation'),
4 =&gt; __('Refund'),
];

if (array_key_exists($this-&gt;order-&gt;status, $descriptions)) {
return $descriptions[$this-&gt;order-&gt;status];
}

return 'Unknown';
return match ($this-&gt;order-&gt;status) {
Order::STATUS_PROCESS =&gt; __('In the process'),
Order::STATUS_PAID =&gt; __('Paid'),
Order::STATUS_CANCELLATION =&gt; __('Cancellation'),
Order::STATUS_REFUND =&gt; __('Refund'),
default =&gt; __('Unknown'),
};
}

/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|\Closure|string
*/
public function render()
public function render(): \Illuminate\View\View|\Closure|string
{
return view('components.order.short-information');
}
Expand Down

0 comments on commit c126664

Please sign in to comment.