Releases: mammutgroup/l5-repository
Releases · mammutgroup/l5-repository
remove dupplicated craiterion
3.0.0 remove dupplicated criterias
route criteria
now you can add this configs to any route
$api->get('', [
\\...,
'criterion' => [
'CriteriaName'=>'RepositoryName'
],
]);
if you want to apply a criteria to all repositories
$api->get('', [
\\...,
'criterion' => [
'CriteriaName' => '*'
]
]);
if you want to apply a criteria on only one repository
$api->get('', [
\\...,
'criterion' => [
'CriteriaName'=>'RepositoryName'
]
]);
if you want to apply any criteria to all repositories except a repository
$api->get('', [
\\...,
'criterion' => [
'CriteriaName' => [
'except'=>'RepositoryName'
]
]
]);
if you want to apply any criteria to all repositories except some repositories
$api->get('', [
\\...,
'criterion' => [
'CriteriaName'=> [
'except' => [
'RepositoryName1',
'RepositoryName2'
]
]
]
]);
if you want to apply a criteria to any repository with a condition
in this case you can use a function that this function takes 3 parameter:
$repository: this param give an instance of current repository that this criteria wants to apply on it
$currentUser give you \Auth::user()
$app give you app()
$api->get('', [
\\...,
'criterion' => [
'CriteriaName'=> function($repository, $currentUser, $app){
if(1 == 1){
return true;
}
return false;
}
]
]);
2.5.4: Merge pull request #2 from sayadaazami/master
modify pagination
2.5.3: Merge pull request #1 from sayadaazami/master
modify pagination in BaseRepository.php