<?php

namespace App\Orchid\Layouts\Promocode;

use Orchid\Screen\Field;
use Orchid\Screen\Layouts\Rows;
use Orchid\Screen\Fields\Input;
use Orchid\Screen\Fields\DateTimer;

class PromocodeCreateLayout extends Rows {

  protected $title;

  protected function fields(): iterable {
    return [
      Input::make('promocode.code')
        ->type('text')
        ->max(255)
        ->required()
        ->title(__('Code'))
        ->placeholder(__('Promocode')),

      Input::make('promocode.discount')
        ->type('number')
        ->max(100)
        ->required()
        ->title(__('Discount'))
        ->placeholder(__('Discount')),

      DateTimer::make('promocode.expires_at')
        ->title(__('Expires at'))
        ->format('Y-m-d')
    ];
  }
}
