-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,006 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
* text=auto | ||
|
||
.github/ export-ignore | ||
tests/ export-ignore | ||
|
||
.codecov.yml export-ignore | ||
.editorconfig export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.scrutinizer.yml export-ignore | ||
.styleci.yml export-ignore | ||
|
||
phpunit.xml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.idea/ | ||
|
||
build/ | ||
node_modules/ | ||
vendor/ | ||
|
||
*.bak | ||
*.cache | ||
*.clover | ||
*.orig | ||
|
||
*.lock | ||
|
||
mix-manifest.json | ||
|
||
resources/apps/ | ||
.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
preset: psr12 | ||
|
||
risky: true | ||
|
||
enabled: | ||
- align_double_arrow | ||
- align_equals | ||
- align_phpdoc | ||
- alpha_ordered_imports | ||
- binary_operator_spaces | ||
- blank_line_before_continue | ||
- blank_line_before_declare | ||
- blank_line_before_return | ||
- blank_line_before_throw | ||
- blank_line_before_try | ||
- cast_spaces | ||
- combine_consecutive_issets | ||
- const_separation | ||
- dir_constant | ||
- fully_qualified_strict_types | ||
- logical_operators | ||
- method_separation | ||
- no_alias_functions | ||
- no_blank_lines_after_phpdoc | ||
- no_blank_lines_between_traits | ||
- no_empty_comment | ||
- no_empty_phpdoc | ||
- no_extra_block_blank_lines | ||
- no_extra_consecutive_blank_lines | ||
- no_short_bool_cast | ||
- no_trailing_comma_in_singleline_array | ||
- no_unneeded_control_parentheses | ||
- no_unused_imports | ||
- ordered_class_elements | ||
- php_unit_construct | ||
- php_unit_fqcn_annotation | ||
- phpdoc_indent | ||
- phpdoc_inline_tag | ||
- phpdoc_link_to_see | ||
- phpdoc_no_access | ||
- phpdoc_no_empty_return | ||
- phpdoc_no_package | ||
- phpdoc_no_useless_inheritdoc | ||
- phpdoc_order | ||
- phpdoc_property | ||
- phpdoc_return_self_reference | ||
- phpdoc_scalar | ||
- phpdoc_separation | ||
- phpdoc_summary | ||
- phpdoc_to_comment | ||
- phpdoc_trim | ||
- phpdoc_type_to_var | ||
- phpdoc_types | ||
- phpdoc_types_order | ||
- phpdoc_var_without_name | ||
- property_separation | ||
- self_accessor | ||
- short_array_syntax | ||
- short_list_syntax | ||
- single_line_class_definition | ||
- single_line_throw | ||
- single_quote | ||
- space_after_semicolon | ||
- standardize_not_equals | ||
- ternary_to_null_coalescing | ||
- trailing_comma_in_multiline_array | ||
- trim_array_spaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Ultimate Support | ||
|
||
[![EgoistDeveloper Laravel Support](https://preview.dragon-code.pro/EgoistDeveloper/Ultimate-Support.svg?brand=laravel)](https://github.com/laravel-ready/ultimate-support) | ||
|
||
[![Stable Version][badge_stable]][link_packagist] | ||
[![Unstable Version][badge_unstable]][link_packagist] | ||
[![Total Downloads][badge_downloads]][link_packagist] | ||
[![License][badge_license]][link_license] | ||
|
||
|
||
Support collection for Laravel. This package is standalone and does not require external packages. | ||
|
||
|
||
# Support Classes | ||
|
||
## IpSupport | ||
|
||
Contains methods for working with IP addresses. | ||
|
||
`use LaravelReady\UltimateSupport\Support\IpSupport;` | ||
|
||
| Method | Description | Result | | ||
| ------ | ----------- | ------ | | ||
| **isLocalhost** | Check client is from localhost | `boolean` | | ||
| **getLocalhostPublicIp** | Get client public IP address if it is localhost | `null` or `string` | | ||
| **getIP** | Get client real IP address | `string` | | ||
|
||
- The `getLocalhostPublicIp` method is useful for checking if the client is from localhost. Uses https://api.ipify.org/?format=json endpoint. | ||
- In laravel native way you can use `Request::ip()` method but this method is cover all cases. For example cloudflare, nginx, etc. Also see this stackoverflow [question](https://stackoverflow.com/q/13646690/6940144). | ||
|
||
|
||
[badge_downloads]: https://img.shields.io/packagist/dt/laravel-ready/ultimate-support.svg?style=flat-square | ||
|
||
[badge_license]: https://img.shields.io/packagist/l/laravel-ready/ultimate-support.svg?style=flat-square | ||
|
||
[badge_stable]: https://img.shields.io/github/v/release/laravel-ready/ultimate-support?label=stable&style=flat-square | ||
|
||
[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square | ||
|
||
[link_license]: LICENSE | ||
|
||
[link_packagist]: https://packagist.org/packages/laravel-ready/ultimate-support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "laravel-ready/ultimate-support", | ||
"description": "A few useful reusable support package for Laravel", | ||
"type": "library", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
"laravel", | ||
"ultimate-support", | ||
"support" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "EgoistDeveloper", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/laravel-ready/ultimate-support/issues", | ||
"source": "https://github.com/laravel-ready/ultimate-support" | ||
}, | ||
"require": { | ||
"php": "^8.0.2", | ||
"illuminate/support": "^9.0" | ||
}, | ||
"require-dev": { | ||
"mockery/mockery": "^1.4", | ||
"orchestra/testbench": "^7.0.0", | ||
"phpunit/phpunit": "^9.5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"LaravelReady\\UltimateSupport\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests" | ||
} | ||
}, | ||
"config": { | ||
"preferred-install": "dist", | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"LaravelReady\\UltimateSupport\\UltimateSupportServiceProvider" | ||
], | ||
"aliases": { | ||
"UltimateSupport": "LaravelReady\\UltimateSupport\\Facades\\UltimateSupport" | ||
} | ||
} | ||
}, | ||
"minimum-stability": "stable", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace LaravelReady\LicenseServer\Exceptions; | ||
|
||
use Exception; | ||
|
||
final class LicenseException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace LaravelReady\UltimateSupport\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class UltimateSupport extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'ultimate-support'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace LaravelReady\UltimateSupport; | ||
|
||
use Illuminate\Support\ServiceProvider as BaseServiceProvider; | ||
|
||
use LaravelReady\UltimateSupport\Facades\UltimateSupport; | ||
|
||
final class LicenseServerServiceProvider extends BaseServiceProvider | ||
{ | ||
public function boot(): void | ||
{ | ||
} | ||
|
||
public function register(): void | ||
{ | ||
$this->app->singleton('ultimate-support', function () { | ||
return new UltimateSupport(); | ||
}); | ||
} | ||
} |