sortable(), Attribute::make('active')->sortable(), Attribute::make('order')->sortable(), Attribute::make('iban')->sortable(), Attribute::make('account_type'), Attribute::make('account_role'), Attribute::make('account_number')->sortable(), // currency Attribute::make('currency_id'), Attribute::make('currency_name'), Attribute::make('currency_code'), Attribute::make('currency_symbol'), Attribute::make('currency_decimal_places'), Attribute::make('is_multi_currency'), // balance Attribute::make('balance')->sortable(), Attribute::make('native_balance')->sortable(), // liability things Attribute::make('liability_direction'), Attribute::make('interest'), Attribute::make('interest_period'), // Attribute::make('current_debt')->sortable(), // TODO credit card fields. // dynamic data Attribute::make('last_activity')->sortable(), Attribute::make('balance_difference')->sortable(), // only used for sort. // group Attribute::make('object_group_id'), Attribute::make('object_group_title'), Attribute::make('object_group_order'), // relations. HasOne::make('user')->readOnly(), ]; } /** * Get the resource filters. */ public function filters(): array { Log::debug(__METHOD__); $array = []; $config = config('api.valid_api_filters')[Account::class]; foreach ($config as $entry) { $array[] = Filter::make($entry); } return $array; } public function repository(): AccountRepository { Log::debug(__METHOD__); $this->setUserGroup($this->server->getUsergroup()); return AccountRepository::make() ->withServer($this->server) ->withSchema($this) ->withUserGroup($this->userGroup) ; } public function pagination(): EnumerablePagination { Log::debug(__METHOD__); return EnumerablePagination::make(); } }