Skip to main content

daravel_teorion 1.13.0 copy "daravel_teorion: ^1.13.0" to clipboard
daravel_teorion: ^1.13.0 copied to clipboard

Request-driven query filters for Daravel with whitelists for filters, scopes, relations and sorts, the request format of laravel-teorion.

Daravel

daravel_teorion #

English · Bahasa Indonesia

Request-driven query filters for Daravel: a listing's query string becomes filters, eager loads, counts, sorts and pagination, within whitelists declared once per model. A port of laravel-teorion with its request format, so one client works against a Laravel and a Daravel API alike.

dart pub add daravel_teorion
dartisan make:query-filter Post
final class PostQueryFilter extends QueryFilter<Post> {
  @override
  Map<String, Filter> get filters => {
    'search': Filter.multiLike(['title', 'body']).alias('q'),
    'status': Filter.enum_('status', PostStatus.values),
  };

  @override
  List<String> get allowedSorts => ['created_at', 'title'];
}

router.get('/posts', (request) => Post.definition.query().filterAndPaginate(request));
GET /posts?q=dart&withs[]=author&sort=-created_at&is_paginate=1&per_page=20
  • Seventeen filter types with alias, withDefault and required, macros, legacy and isolated scopes, withs, withCounts, withAggregates, three sort formats, pages, cursors, soft deletes and visibles / hiddens.
  • Validation rules, OpenAPI parameters and a fingerprinted audit event.
  • Tested on SQLite, PostgreSQL and MariaDB.

Documentation: https://github.com/daravel-dev/daravel/blob/main/docs/guide/query-filters.md.

License and trademarks #

MIT. "Laravel" is a trademark of Laravel Holdings Inc.; "Dart" is a trademark of Google LLC. Daravel is an independent project, not affiliated with or endorsed by either.

0
likes
160
points
--
downloads

Documentation

Documentation
API reference

Publisher

verified publisherframework.daravel.dev

Weekly Downloads

Request-driven query filters for Daravel with whitelists for filters, scopes, relations and sorts, the request format of laravel-teorion.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#query #filter #api #server #backend

License

MIT (license)

Dependencies

crypto, daravel

More

Packages that depend on daravel_teorion