Skip to content

Releases: mammutgroup/l5-repository

remove dupplicated craiterion

16 Jan 07:10
Compare
Choose a tag to compare
3.0.0

remove dupplicated criterias

route criteria

12 Jan 09:42
Compare
Choose a tag to compare

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

26 Jul 13:20
Compare
Choose a tag to compare

2.5.3: Merge pull request #1 from sayadaazami/master

25 Jul 12:39
Compare
Choose a tag to compare
modify pagination in  BaseRepository.php

2.5.2

28 May 09:00
Compare
Choose a tag to compare
fix bug