public $start; public $end; public $salesperson = 0; public $options; public ?array $data = []; public function mount(): void { $this->form->fill([ // $this->start = now()->subDays(7)->format('Y-m-d h:i:s'), // $this->end = now()->format('Y-m-d h:i:s'), // $this->salesperson = 0, 'start' => now()->subDays(7)->format('Y-m-d h:i:s'), 'end' => now()->format('Y-m-d h:i:s'), 'salesperson' => 0, ]); $options = []; $options[0] = 'All'; $salespeople = User::orderBy('created_at', 'desc')->get(); foreach($salespeople as $salesperson) { $options[$salesperson->id] = $salesperson->name; } $this->options = $options; } public function getFormSchema(): array { return [ Grid::make(3)->schema([ DatePicker::make('start'), DatePicker::make('end'), Select::make('salesperson') ->multiple() ->searchable() ->options($this->options) ->disablePlaceholderSelection() ->live() ]) ->statePath('data'), ]; }
public $start; public $end; public $salesperson = 0; public $options; public function mount(): void { $this->start = now()->subDays(7)->format('Y-m-d h:i:s'); $this->end = now()->format('Y-m-d h:i:s'); $this->salesperson = 0; $options = []; $options[0] = 'All'; $salespeople = User::orderBy('created_at', 'desc')->get(); foreach($salespeople as $salesperson) { $options[$salesperson->id] = $salesperson->name; } $this->options = $options; } public function getFormSchema(): array { return [ Grid::make(3)->schema([ DatePicker::make('start'), DatePicker::make('end'), Select::make('salesperson') ->multiple() ->searchable() ->options($this->options) ->disablePlaceholderSelection() ->live(), ])
/var/www/html/public/storage
/var/www/html/storage/app/product-image