Skip to content

Commit

Permalink
Merge pull request #1 from arabnewscms/1.0.9
Browse files Browse the repository at this point in the history
update and add afterShow
  • Loading branch information
arabnewscms authored May 21, 2023
2 parents 082e2c1 + 9b66a9f commit e8de0e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"email":"php.anonymous1@gmail.com",
"homepage":"https://github.com/arabnewscms"
}
],
],
"license": "MIT",
"autoload": {
"psr-4": {
Expand All @@ -20,18 +20,18 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.8.x-dev"
"dev-master": "1.0.9.x-dev"
},
"laravel": {
"providers": [
"Lynx\\LynxProvider"
],
"aliases": {

}
}
},
"version":"1.0.8",
"version":"1.0.9",
"minimum-stability": "dev",
"prefer-stable": true
}
1 change: 1 addition & 0 deletions src/Base/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function show($id) {
->message(__('lynx.not_found'))
->response();
} else {
$data = $this->afterShow($data);
return lynx()->data($data)->response();
}
}
Expand Down
11 changes: 10 additions & 1 deletion src/Base/Traits/Queryable.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public function beforeShow($entity):Object {
return $entity;
}

/**
* master of query method
* @return query methods
*/
public function afterShow($entity):Object {
// return new $this->resourcesJson($entity);
return $entity;
}

/**
* master of query method
* @return query methods
Expand Down Expand Up @@ -90,4 +99,4 @@ public function appendShowQuery() {
return $this->beforeShow(new $this->entity)->orderBy(request('orderBy', 'id'), request('sort', 'desc'));
}

}
}

0 comments on commit e8de0e0

Please sign in to comment.