'outside']); } public function setUp(): array { $actions = []; $header = PowerGrid::header() ->withoutLoading() ->showToggleColumns(); $header->includeViewOnTop('livewire.headers.song-library-cache'); $actions[]=$header; $actions[]=PowerGrid::footer()->showPerPage()->showRecordCount(); return $actions; } public function datasource(): Builder { return SongLibraryCache::query()->orderBy('song_id'); } public function relationSearch(): array { return []; } public function fields(): PowerGridFields { return PowerGrid::fields() ->add('song_id') ->add('song_name') ->add('song_simplified') ->add('phonetic_abbr') ->add('pinyin_abbr') ->add('strokes_abbr') ->add('song_number') ->add('artistA') ->add('artistB') ->add('artistA_simplified') ->add('artistB_simplified') ->add('artistA_category') ->add('artistB_category') ->add('artist_category') ->add('song_filename') ->add('song_category') ->add('language_name') ->add('add_date_formatted', fn (SongLibraryCache $model) => Carbon::parse($model->add_date)->format('Y-m-d')) ->add('situation') ->add('vocal') ->add('db_change') ->add('song_counts') ->add('updated_at_formatted', fn (SongLibraryCache $model) => Carbon::parse($model->updated_at)->format('Y-m-d H:i:s')); } public function columns(): array { $column=[]; $column[]=Column::make(__('song-library-cache.id'), 'song_id'); $column[]=Column::make(__('song-library-cache.name'), 'song_name')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.simplified'), 'song_simplified')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.name.phinetic'), 'phonetic_abbr')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.name.pinyin'), 'pinyin_abbr')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.name.strokes'), 'strokes_abbr')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.name_length'), 'song_number')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.artists').'A', 'artistA')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.artists').'B', 'artistB')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.artists_simplified').'A', 'artistA_simplified')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.artists_simplified').'B', 'artistB_simplified')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.artists_category').'A', 'artistA_category')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.artists_category').'B', 'artistB_category')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.artists_category'), 'artist_category')->sortable()->searchable()->hidden(true, false); $column[]=Column::make(__('song-library-cache.filename'), 'song_filename')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.categorys'), 'song_category')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.language_type'), 'language_name')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.adddate'), 'add_date_formatted', 'add_date')->sortable(); $column[]=Column::make(__('song-library-cache.situation'), 'situation')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.vocal'), 'vocal')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.db_change'), 'db_change')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.counts'), 'song_counts')->sortable()->searchable(); $column[]=Column::make(__('song-library-cache.updated_at'), 'updated_at_formatted', 'updated_at')->sortable()->hidden(true, false); return $column; } public function filters(): array { return [ Filter::datepicker('add_date'), Filter::datetimepicker('updated_at'), ]; } }