Skip to content

Commit ee22b47

Browse files
committed
Remove Illuminate dependencies, update zend-diactoros
1 parent b9431c8 commit ee22b47

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
"name": "tobscure/json-api-server",
33
"require": {
44
"php": "^7.2",
5-
"illuminate/database": "5.7.*",
6-
"illuminate/events": "5.7.*",
7-
"illuminate/validation": "5.7.*",
8-
"zendframework/zend-diactoros": "^1.8",
5+
"doctrine/inflector": "^1.3",
96
"json-api-php/json-api": "^2.0",
7+
"psr/http-message": "^1.0",
108
"psr/http-server-handler": "^1.0",
11-
"psr/http-message": "^1.0"
9+
"spatie/macroable": "^1.0",
10+
"zendframework/zend-diactoros": "^2.0"
1211
},
1312
"license": "MIT",
1413
"authors": [
@@ -29,5 +28,8 @@
2928
},
3029
"require-dev": {
3130
"phpunit/phpunit": "^7.4"
31+
},
32+
"config": {
33+
"sort-packages": true
3234
}
3335
}

src/Schema/Attribute.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Tobscure\JsonApiServer\Schema;
44

55
use Closure;
6-
use Illuminate\Support\Traits\Macroable;
6+
use Spatie\Macroable\Macroable;
77

88
class Attribute extends Field
99
{
@@ -16,8 +16,6 @@ class Attribute extends Field
1616
public function __construct(string $name)
1717
{
1818
parent::__construct($name);
19-
20-
$this->property = snake_case($name);
2119
}
2220

2321
public function sortable(Closure $callback = null)

src/Schema/HasOne.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace Tobscure\JsonApiServer\Schema;
44

5+
use Doctrine\Common\Inflector\Inflector;
6+
57
class HasOne extends Relationship
68
{
79
public function __construct(string $name)
810
{
911
parent::__construct($name);
1012

11-
$this->resource = str_plural($name);
13+
$this->resource = Inflector::pluralize($name);
1214
}
1315
}

src/Schema/Relationship.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Tobscure\JsonApiServer\Schema;
44

55
use Closure;
6-
use Illuminate\Support\Traits\Macroable;
6+
use Spatie\Macroable\Macroable;
77

88
abstract class Relationship extends Field
99
{

0 commit comments

Comments
 (0)