Skip to content

Commit 9b7d395

Browse files
author
Andrey Helldar
authored
Merge pull request #5 from TheDragonCode/3.x
Changed namespace
2 parents 35ba05c + f845a4d commit 9b7d395

17 files changed

+50
-106
lines changed

.editorconfig

-15
This file was deleted.

README.md

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
# Laravel Support
22

3-
Various helper files for the Laravel and Lumen frameworks.
4-
53
<img src="https://preview.dragon-code.pro/TheDragonCode/laravel-support.svg?brand=laravel" alt="Laravel Support"/>
64

75
<p align="center">
86
<a href="https://styleci.io/repos/258101736"><img src="https://styleci.io/repos/258101736/shield" alt="StyleCI" /></a>
9-
<a href="https://packagist.org/packages/andrey-helldar/laravel-support"><img src="https://img.shields.io/packagist/dt/andrey-helldar/laravel-support.svg?style=flat-square" alt="Total Downloads" /></a>
10-
<a href="https://packagist.org/packages/andrey-helldar/laravel-support"><img src="https://poser.pugx.org/andrey-helldar/laravel-support/v/stable?format=flat-square" alt="Latest Stable Version" /></a>
11-
<a href="https://packagist.org/packages/andrey-helldar/laravel-support"><img src="https://poser.pugx.org/andrey-helldar/laravel-support/v/unstable?format=flat-square" alt="Latest Unstable Version" /></a>
12-
<a href="https://travis-ci.org/andrey-helldar/laravel-support"><img src="https://travis-ci.org/andrey-helldar/laravel-support.svg?branch=master" alt="Travis CI" /></a>
13-
<a href="LICENSE"><img src="https://poser.pugx.org/andrey-helldar/laravel-support/license?format=flat-square" alt="License" /></a>
7+
<a href="https://packagist.org/packages/dragon-code/laravel-support"><img src="https://img.shields.io/packagist/dt/dragon-code/laravel-support.svg?style=flat-square" alt="Total Downloads" /></a>
8+
<a href="https://packagist.org/packages/dragon-code/laravel-support"><img src="https://poser.pugx.org/dragon-code/laravel-support/v/stable?format=flat-square" alt="Latest Stable Version" /></a>
9+
<a href="https://packagist.org/packages/dragon-code/laravel-support"><img src="https://poser.pugx.org/dragon-code/laravel-support/v/unstable?format=flat-square" alt="Latest Unstable Version" /></a>
10+
<a href="https://travis-ci.org/dragon-code/laravel-support"><img src="https://travis-ci.org/dragon-code/laravel-support.svg?branch=master" alt="Travis CI" /></a>
11+
<a href="LICENSE"><img src="https://poser.pugx.org/dragon-code/laravel-support/license?format=flat-square" alt="License" /></a>
1412
</p>
1513

14+
> Various helper files for the Laravel and Lumen frameworks.
15+
1616

1717
## License
1818

1919
This package is licensed under the [MIT License](LICENSE).
20-
21-
22-
## For Enterprise
23-
24-
Available as part of the Tidelift Subscription.
25-
26-
The maintainers of `andrey-helldar/laravel-support` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more](https://tidelift.com/subscription/pkg/packagist-andrey-helldar-laravel-support?utm_source=packagist-andrey-helldar-laravel-support&utm_medium=referral&utm_campaign=enterprise&utm_term=repo).

SECURITY.md

-5
This file was deleted.

composer.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "andrey-helldar/laravel-support",
2+
"name": "dragon-code/laravel-support",
33
"description": "Various helper files for the Laravel and Lumen frameworks",
44
"type": "library",
55
"license": "MIT",
6-
"keywords": ["support", "laravel", "lumen", "framework"],
6+
"keywords": ["support", "laravel", "lumen", "framework", "dragon-code", "dragon", "andrey-helldar"],
77
"support": {
8-
"issues": "https://github.com/andrey-helldar/laravel-support/issues",
9-
"source": "https://github.com/andrey-helldar/laravel-support"
8+
"issues": "https://github.com/TheDragonCode/laravel-support/issues",
9+
"source": "https://github.com/TheDragonCode/laravel-support"
1010
},
1111
"authors": [
1212
{
@@ -16,16 +16,16 @@
1616
],
1717
"require": {
1818
"php": "^7.2|^8.0",
19-
"illuminate/container": "^5.0|^6.0|^7.0|^8.0",
20-
"illuminate/database": "^5.0|^6.0|^7.0|^8.0",
21-
"illuminate/http": "^5.0|^6.0|^7.0|^8.0",
22-
"illuminate/support": "^5.0|^6.0|^7.0|^8.0",
19+
"illuminate/container": "^6.0|^7.0|^8.0",
20+
"illuminate/database": "^6.0|^7.0|^8.0",
21+
"illuminate/http": "^6.0|^7.0|^8.0",
22+
"illuminate/support": "^6.0|^7.0|^8.0",
2323
"ramsey/uuid": "^3.7|^4.0",
24-
"symfony/var-dumper": "^2.6|^3.0|^4.0|^5.0"
24+
"symfony/var-dumper": "^4.0|^5.0"
2525
},
2626
"autoload": {
2727
"psr-4": {
28-
"Helldar\\LaravelSupport\\": "src"
28+
"DragonCode\\LaravelSupport\\": "src"
2929
},
3030
"files": [
3131
"helpers/dumper.php"

helpers/dumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Helldar\LaravelSupport\Facades\Dumper;
3+
use DragonCode\LaravelSupport\Facades\Dumper;
44

55
if (! function_exists('dd_sql')) {
66
/**

phpunit.xml.dist

-28
This file was deleted.

src/Eloquent/CompositeKeysModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Eloquent;
3+
namespace DragonCode\LaravelSupport\Eloquent;
44

55
use Illuminate\Contracts\Support\Arrayable;
66
use Illuminate\Database\Eloquent\Model;

src/Eloquent/Concerns/HasCustomRelationships.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Eloquent\Concerns;
3+
namespace DragonCode\LaravelSupport\Eloquent\Concerns;
44

5-
use Helldar\LaravelSupport\Eloquent\Relations\HasManyCustomRelation;
5+
use DragonCode\LaravelSupport\Eloquent\Relations\HasManyCustomRelation;
66
use Illuminate\Database\Eloquent\Builder;
77
use Illuminate\Database\Eloquent\Model;
88

src/Eloquent/Relations/HasManyCustomRelation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Eloquent\Relations;
3+
namespace DragonCode\LaravelSupport\Eloquent\Relations;
44

55
use Illuminate\Database\Eloquent\Builder;
66
use Illuminate\Database\Eloquent\Collection;

src/Eloquent/UuidModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Eloquent;
3+
namespace DragonCode\LaravelSupport\Eloquent;
44

55
use Illuminate\Database\Eloquent\Model;
66
use Ramsey\Uuid\Uuid;

src/Exceptions/IncorrectModelException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Exceptions;
3+
namespace DragonCode\LaravelSupport\Exceptions;
44

55
use Exception;
66
use Illuminate\Database\Eloquent\Model;

src/Facades/App.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Facades;
3+
namespace DragonCode\LaravelSupport\Facades;
44

5-
use Helldar\LaravelSupport\Support\App as Support;
5+
use DragonCode\LaravelSupport\Support\App as Support;
66
use Illuminate\Support\Facades\Facade;
77

88
/**
99
* @method static bool isLaravel()
1010
* @method static bool isLumen()
1111
*/
12-
final class App extends Facade
12+
class App extends Facade
1313
{
14-
protected static function getFacadeAccessor()
14+
protected static function getFacadeAccessor(): string
1515
{
1616
return Support::class;
1717
}

src/Facades/Dumper.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Facades;
3+
namespace DragonCode\LaravelSupport\Facades;
44

5-
use Helldar\LaravelSupport\Support\Dumper as Support;
5+
use DragonCode\LaravelSupport\Support\Dumper as Support;
66
use Illuminate\Support\Facades\Facade;
77

88
/**
@@ -12,7 +12,7 @@
1212
*/
1313
class Dumper extends Facade
1414
{
15-
protected static function getFacadeAccessor()
15+
protected static function getFacadeAccessor(): string
1616
{
1717
return Support::class;
1818
}

src/Support/App.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Support;
3+
namespace DragonCode\LaravelSupport\Support;
44

55
use Illuminate\Foundation\Application as LaravelApp;
66
use Laravel\Lumen\Application as LumenApp;
77

8-
final class App
8+
class App
99
{
1010
public function isLaravel(): bool
1111
{

src/Support/Dumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Support;
3+
namespace DragonCode\LaravelSupport\Support;
44

55
use Illuminate\Database\Eloquent\Builder;
66
use Illuminate\Database\Query\Builder as QueryBuilder;

src/Support/ModelHelper.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Support;
3+
namespace DragonCode\LaravelSupport\Support;
44

5-
use Helldar\LaravelSupport\Exceptions\IncorrectModelException;
5+
use DragonCode\LaravelSupport\Exceptions\IncorrectModelException;
66
use Illuminate\Database\Eloquent\Model;
77

88
class ModelHelper
@@ -12,7 +12,7 @@ class ModelHelper
1212
/**
1313
* @param \Illuminate\Database\Eloquent\Model|string $model
1414
*
15-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
15+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
1616
*
1717
* @return string
1818
*/
@@ -26,7 +26,7 @@ public function connection($model): ?string
2626
/**
2727
* @param \Illuminate\Database\Eloquent\Model|string $model
2828
*
29-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
29+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
3030
*
3131
* @return string
3232
*/
@@ -40,7 +40,7 @@ public function table($model): string
4040
/**
4141
* @param \Illuminate\Database\Eloquent\Model|string $model
4242
*
43-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
43+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
4444
*
4545
* @return string
4646
*/
@@ -57,7 +57,7 @@ public function tableWithConnection($model): string
5757
/**
5858
* @param \Illuminate\Database\Eloquent\Model|string $model
5959
*
60-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
60+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
6161
*
6262
* @return string
6363
*/
@@ -71,7 +71,7 @@ public function primaryKey($model): string
7171
/**
7272
* @param \Illuminate\Database\Eloquent\Model|string $model
7373
*
74-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
74+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
7575
*
7676
* @return string
7777
*/
@@ -95,7 +95,7 @@ public function className($model): string
9595
/**
9696
* @param \Illuminate\Database\Eloquent\Model|string $model
9797
*
98-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
98+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
9999
*
100100
* @return array
101101
*/
@@ -110,7 +110,7 @@ public function fillable($model): array
110110
* @param \Illuminate\Database\Eloquent\Model|string $model
111111
* @param \Illuminate\Http\Request $request
112112
*
113-
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
113+
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
114114
*
115115
* @return array
116116
*/

src/Traits/InitModelHelper.php

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
<?php
22

3-
namespace Helldar\LaravelSupport\Traits;
3+
namespace DragonCode\LaravelSupport\Traits;
44

5-
use Helldar\LaravelSupport\Support\ModelHelper;
5+
use DragonCode\LaravelSupport\Support\ModelHelper;
66
use Illuminate\Container\Container;
77

88
trait InitModelHelper
99
{
10-
/** @var \Helldar\LaravelSupport\Support\ModelHelper */
10+
/** @var \DragonCode\LaravelSupport\Support\ModelHelper */
1111
protected static $model_helper;
1212

1313
/**
1414
* @throws \Illuminate\Contracts\Container\BindingResolutionException
1515
*
16-
* @return \Helldar\LaravelSupport\Support\ModelHelper
16+
* @return \DragonCode\LaravelSupport\Support\ModelHelper
1717
*/
1818
protected function model(): ModelHelper
1919
{
20-
if (static::$model_helper === null) {
21-
static::$model_helper = Container::getInstance()
22-
->make(ModelHelper::class);
20+
if (static::$model_helper) {
21+
return static::$model_helper;
2322
}
2423

25-
return static::$model_helper;
24+
return static::$model_helper = Container::getInstance()->make(ModelHelper::class);
2625
}
2726
}

0 commit comments

Comments
 (0)