All notable changes to laravel-repository
will be documented in this file.
- feat: return $this from setResource()
- feat: allow passing 'guard' to
user()
on ResourceContext. - feat: support authorization (mimics authorizeResource)
- feat: you can change the default key names used in
RequestResourceContext
usingmapKeys()
. See example in README customizing section.
- feat: allow exact match instead of LIKE using
!
after property name. See updated README filtering section. - bugfix: the set_allowed_with failed for when a plain array was passed as context.
- refactor: the
toArray()
function will return the original value ofpage
andper_page
. While the output no longer truely reflects what is used in the Repository class it makes it much more useful working with. E.g if want to modify a ResourceContext you can convert it to an ArrayContext. Often you don't care about the pagination details, but prior to this version you would have to always excludepage
otherwise a non-page request would become paged.
- feat: support relations in piped filters E.g user search
address.email|address.phone
.
- bugfix:
set()
would create too many levels of array
- feat: 1st argument to
setContext()
can be an array to get ArrayResourceContext - feat: add 2nd argument to
setContext()
so automatically setAllowedWith equal to whatever is set in the context. - refactor:
ArrayResourceContext::merge()
is now recursive - feat: add
get()
andset()
to ArrayResourceContext that respects valid keys - feat: add toArray to ArrayResourceContext + ResourceContext as well
- refactor: only use known values when creating an array context
- feat: similar to
Resource
methods you can useQuery
to get the query builder instead of the result. - feat: list() called without column parameter will attempt to use default sort by.
- refactor: eliminate WITH_ALL and WITH_NONE constants. Just use
[]
and[*]
instead. This the Laravel way.
- feat: pass array to
Repository::for()
without the need to specifyArrayResourceContext
- feat: add
default_list_column
- feat: add
register()
method for sub-classes
- feat: support for JsonResource (see README resources section)
- feat: add
list()
- fix: correctly deal with depper nested filters
- docs: add CONTRIBUTING text
- fix: throw exception if input query doesn't match model
- chore: run test using MySQL in travis to make sure
CONCAT_WS
is tested as it is not supported by SQLite.
- Initial release