Skip to content

Commit 0b45996

Browse files
authored
Merge pull request #2 from omaralalwi/bugfix-with-function-name
Bugfix with function name
2 parents 7b0d086 + 408ac3d commit 0b45996

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<h1 align="center">Laravel API Helpers 🚀</h1>
3-
<p align="center">**Laravel API Helpers** is a collection of helper functions designed to streamline API development with Laravel. It enables you to easily detect API versions, validate requests, and access useful request details—all while keeping your code clean and maintainable. ✨</p>
3+
<p align="center"> Laravel API Helpers is a collection of helper functions designed to streamline API development with Laravel. It enables you to easily detect API versions, validate requests, and access useful request details—all while keeping your code clean and maintainable. ✨</p>
44

55
<p align="center">
66
<a href="https://packagist.org/packages/omaralalwi/laravel-api-helpers">
@@ -12,9 +12,6 @@
1212
<a href="LICENSE.md">
1313
<img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="License">
1414
</a>
15-
<a href="https://github.com/omaralalwi/laravel-api-helpers/actions">
16-
<img src="https://img.shields.io/github/actions/workflow/status/omaralalwi/laravel-api-helpers/tests.yml" alt="Tests Status">
17-
</a>
1815
</p>
1916

2017
## 🌟 Features

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"homepage": "https://github.com/omaralalwi/laravel-api-helpers",
4242
"license": "MIT",
4343
"type": "library",
44-
"version": "1.0.2",
44+
"version": "1.0.3",
4545
"authors": [
4646
{
4747
"name": "omar alalwi",

src/helpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ function get_api_v()
3535
* Compares the version extracted from the request (via path or header)
3636
* to the provided version number.
3737
*
38-
* **Note:** This function calls `get_api_version()`, which should be updated to `get_api_v()` if intended.
38+
* **Note:** This function calls `get_api_v()`, which should be updated to `get_api_v()` if intended.
3939
*
4040
* @param int $version The version number to check against.
4141
* @return bool True if the current API version matches the specified version; otherwise, false.
4242
*/
4343
function is_api_v($version)
4444
{
45-
return get_api_version() === (int) $version;
45+
return get_api_v() === (int) $version;
4646
}
4747
}
4848

@@ -52,14 +52,14 @@ function is_api_v($version)
5252
*
5353
* Compares the API version from the request with the provided minimum version.
5454
*
55-
* **Note:** This function calls `get_api_version()`, which should be updated to `get_api_v()` if intended.
55+
* **Note:** This function calls `get_api_v()`, which should be updated to `get_api_v()` if intended.
5656
*
5757
* @param int $version The minimum version to check against.
5858
* @return bool True if the current API version is greater than or equal to the specified version; otherwise, false.
5959
*/
6060
function api_v_at_least($version)
6161
{
62-
$currentVersion = get_api_version();
62+
$currentVersion = get_api_v();
6363

6464
if ($currentVersion === null) {
6565
return false;

0 commit comments

Comments
 (0)