Skip to content

Commit 933205d

Browse files
authored
Merge pull request #86 from Rubens10010/FixForLaravel9
Missing changes for laravel 9
2 parents e92482f + ee829eb commit 933205d

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.1.3|^8.0",
14+
"php": "^8.0",
1515
"alymosul/exponent-server-sdk-php": "1.3.*",
16-
"laravel/framework": "^5.6 | ^6.0 | ^7.0 | ^8.0 | ^9.0"
16+
"laravel/framework": "^9.0"
1717
},
1818
"require-dev": {
19-
"mockery/mockery": "^0.9.5||^1.0",
20-
"phpunit/phpunit": "~5.4||~5.7||~6.0||^7.0||^8.0||^9.0",
21-
"orchestra/testbench": "~3.3||~4.0||^6.0"
19+
"mockery/mockery": "^1.5.0",
20+
"phpunit/phpunit": "^9.0",
21+
"orchestra/testbench": "^7.1.0"
2222
},
2323
"autoload": {
2424
"psr-4": {

src/Http/ExpoController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function subscribe(Request $request)
3939
]);
4040

4141
if ($validator->fails()) {
42-
return JsonResponse::create([
42+
return new JsonResponse([
4343
'status' => 'failed',
4444
'error' => [
4545
'message' => 'Expo Token is required',
@@ -54,15 +54,15 @@ public function subscribe(Request $request)
5454
try {
5555
$this->expoChannel->expo->subscribe($interest, $token);
5656
} catch (\Exception $e) {
57-
return JsonResponse::create([
57+
return new JsonResponse([
5858
'status' => 'failed',
5959
'error' => [
6060
'message' => $e->getMessage(),
6161
],
6262
], 500);
6363
}
6464

65-
return JsonResponse::create([
65+
return new JsonResponse([
6666
'status' => 'succeeded',
6767
'expo_token' => $token,
6868
], 200);
@@ -83,7 +83,7 @@ public function unsubscribe(Request $request)
8383
]);
8484

8585
if ($validator->fails()) {
86-
return JsonResponse::create([
86+
return new JsonResponse([
8787
'status' => 'failed',
8888
'error' => [
8989
'message' => 'Expo Token is invalid',
@@ -96,14 +96,14 @@ public function unsubscribe(Request $request)
9696
try {
9797
$deleted = $this->expoChannel->expo->unsubscribe($interest, $token);
9898
} catch (\Exception $e) {
99-
return JsonResponse::create([
99+
return new JsonResponse([
100100
'status' => 'failed',
101101
'error' => [
102102
'message' => $e->getMessage(),
103103
],
104104
], 500);
105105
}
106106

107-
return JsonResponse::create(['deleted' => $deleted]);
107+
return new JsonResponse(['deleted' => $deleted]);
108108
}
109109
}

src/Models/Interest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ class Interest extends Model
3737
*/
3838
public $timestamps = false;
3939

40+
/**
41+
* Table doesn't have an incrementing ID.
42+
*/
43+
public $incrementing = false;
44+
4045
/**
4146
* Interest constructor.
4247
*

0 commit comments

Comments
 (0)