Skip to content

Commit 73ec0e9

Browse files
committed
fix: lots and lots of stuff
1 parent c7b3628 commit 73ec0e9

16 files changed

Lines changed: 77 additions & 549 deletions

.env.example

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=base64:saRB6NSd4S80J/Uc/gkKeGQpX3iNYw34h664jj6age8=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=mysql
12+
DB_HOST=mysql
13+
DB_PORT=3306
14+
DB_DATABASE=middleware
15+
DB_USERNAME=sail
16+
DB_PASSWORD=password
17+
18+
BROADCAST_DRIVER=log
19+
CACHE_DRIVER=file
20+
FILESYSTEM_DISK=local
21+
QUEUE_CONNECTION=sync
22+
SESSION_DRIVER=database
23+
SESSION_LIFETIME=120
24+
25+
MEMCACHED_HOST=127.0.0.1
26+
27+
REDIS_HOST=redis
28+
REDIS_PASSWORD=null
29+
REDIS_PORT=6379
30+
31+
MAIL_MAILER=smtp
32+
MAIL_HOST=mailpit
33+
MAIL_PORT=1025
34+
MAIL_USERNAME=null
35+
MAIL_PASSWORD=null
36+
MAIL_ENCRYPTION=null
37+
MAIL_FROM_ADDRESS="hello@example.com"
38+
MAIL_FROM_NAME="${APP_NAME}"
39+
40+
AWS_ACCESS_KEY_ID=
41+
AWS_SECRET_ACCESS_KEY=
42+
AWS_DEFAULT_REGION=us-east-1
43+
AWS_BUCKET=
44+
AWS_USE_PATH_STYLE_ENDPOINT=false
45+
46+
PUSHER_APP_ID=
47+
PUSHER_APP_KEY=
48+
PUSHER_APP_SECRET=
49+
PUSHER_HOST=
50+
PUSHER_PORT=443
51+
PUSHER_SCHEME=https
52+
PUSHER_APP_CLUSTER=mt1
53+
54+
VITE_APP_NAME="${APP_NAME}"
55+
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
56+
VITE_PUSHER_HOST="${PUSHER_HOST}"
57+
VITE_PUSHER_PORT="${PUSHER_PORT}"
58+
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
59+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
60+
61+
SCOUT_DRIVER=meilisearch
62+
MEILISEARCH_HOST=http://meilisearch:7700
63+
64+
MEILISEARCH_NO_ANALYTICS=false

app/Enums/ProviderUserResourseStatus.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/Http/Controllers/Api/V1/Controller.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
66
use Illuminate\Foundation\Validation\ValidatesRequests;
77
use Illuminate\Routing\Controller as BaseController;
8-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/Controller.php
9-
10-
=======
11-
>>>>>>> 3336b14 (fix: naming issues in CanvasUtil):middleware/app/Http/Controllers/Controller.php
128

139
class Controller extends BaseController
1410
{
Lines changed: 2 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
<<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
4-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
53
namespace App\Http\Controllers\Api\V1;
64

75

@@ -12,48 +10,22 @@
1210
use App\Models\PlatformConnection;
1311
use App\Http\Resources\PlatformConnectionResource;
1412

15-
=======
16-
========
17-
namespace App\Http\Controllers\api\V1;
18-
19-
>>>>>>>> b6e704f (move to namespace):middleware/app/Http/Controllers/api/V1/PlatformConnectionController.php
20-
use Illuminate\Http\Request;
21-
use App\Http\Controllers\Controller;
22-
use App\Models\PlatformConnection;
23-
>>>>>>> 0feb532 (fix items in review with nokie. PR closes UN-102):middleware/app/Http/Controllers/PlatformConnectionController.php
24-
2513
class PlatformConnectionController extends Controller
2614
{
2715

2816
/* Get all platform connections */
2917
//*************************************************************
30-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
31-
// GET: /api/platform_connection/
18+
// GET: /api/v1/platform_connection/
3219
// Request $req example:
3320
// { "consumer_id": 1 }
3421
// *************************************************************
3522
public function index(): \Illuminate\Http\Resources\Json\AnonymousResourceCollection
3623
{
3724
return PlatformConnectionResource::collection(PlatformConnection::all());
38-
=======
39-
//GET: /api/platform_connection/
40-
// Request $req example:
41-
// { "consumer_id": 1 }
42-
// *************************************************************
43-
public function index(): \Illuminate\Http\JsonResponse
44-
{
45-
try {
46-
$platform_connections = PlatformConnection::all(['*'])->toArray();
47-
return response()->json($platform_connections);
48-
} catch (\Exception) {
49-
return response()->json(['error' => 'Invalid request body'], 401);
50-
}
51-
>>>>>>> 0feb532 (fix items in review with nokie. PR closes UN-102):middleware/app/Http/Controllers/PlatformConnectionController.php
5225
}
5326

5427
/* Create a new platform connection */
5528
//*************************************************************
56-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
5729
// POST: /api/v1/platform_connection/
5830
// PlatformConnectionRequest $req example:
5931
// { "consumer_id": 1, "provider_id": 1, "state": "enabled" }
@@ -70,36 +42,10 @@ public function store(StorePlatformConnectionRequest $req): PlatformConnectionRe
7042
return new PlatformConnectionResource($platform_connection);
7143
} catch (\Exception) {
7244
return response()->json(INVALID_REQUEST_BODY, 401);
73-
=======
74-
//POST: /api/platform_connection/
75-
// Request $req example:
76-
// { "consumer_id": 1, "provider_id": 1, "state": "enabled" }
77-
// *************************************************************
78-
public function store(Request $req): \Illuminate\Http\JsonResponse
79-
{
80-
try {
81-
$consumer_id = $req->input('consumer_id');
82-
$provider_id = $req->input('provider_id');
83-
$state = $req->input('state');
84-
} catch (\Exception) {
85-
return response()->json(['error' => 'Invalid request body'], 401);
86-
}
87-
try {
88-
$platform_connection = PlatformConnection::create([
89-
'consumer_id' => $consumer_id,
90-
'provider_id' => $provider_id,
91-
'state' => $state,
92-
]);
93-
return response()->json($platform_connection);
94-
} catch (\Exception) {
95-
return response()->json(['error' => 'Invalid request body'], 401);
96-
>>>>>>> 0feb532 (fix items in review with nokie. PR closes UN-102):middleware/app/Http/Controllers/PlatformConnectionController.php
9745
}
9846
}
99-
10047
// Get a specific platform connection by consumer or provider id
10148
// *************************************************************
102-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
10349
// GET: /api/v1/platform_connection/{id}
10450
// Request $req example:
10551
// "consumer_id": 1 || "provider_id": 1
@@ -125,56 +71,14 @@ public function update(UpdatePlatformConnectionRequest $req): PlatformConnection
12571
$validated = $req->validated();
12672
$PlatformConnection = PlatformConnection::where($validated)->first();
12773
$PlatformConnection->state = $validated['state'];
128-
return new PlatformConnectionResource($PlatformConnection->save());
12974
if (!$PlatformConnection) {
13075
return response()->json(['error' => 'No matching platform connection found'], 401);
131-
=======
132-
// GET: /api/platform_connection/{id}
133-
// Request $req example:
134-
// "consumer_id": 1 || "provider_id": 1
135-
// *************************************************************
136-
public function show(Request $req): \Illuminate\Http\JsonResponse
137-
{
138-
if ($req->input('provider_id') != null) {
139-
$platform_connection = PlatformConnection::where('platform_id', $req->input('platform_id'))->first();
140-
} else {
141-
$platform_connection = PlatformConnection::where('consumer_id', $req->input('consumer_id'))->first();
142-
}
143-
if (!$platform_connection) {
144-
return response()->json(['error' => 'Invalid request body'], 401);
145-
}
146-
return response()->json_encode($platform_connection, JSON_PRETTY_PRINT);
147-
}
148-
149-
// Update a platform connection
150-
// *************************************************************
151-
// PUT: /api/platform_connection/{request_body}
152-
// Request $req example:
153-
// { "consumer_id": 1, "provider_id": 1, "state": "enabled" }
154-
// *************************************************************
155-
public function update(Request $req): \Illuminate\Http\JsonResponse
156-
{
157-
try {
158-
$consumer_id = $req->input('consumer_id');
159-
$provider_id = $req->input('provider_id');
160-
$state = $req->input('state');
161-
} catch (\Exception) {
162-
return response()->json(['error' => 'Invalid request body'], 401);
163-
}
164-
try {
165-
$platform_connection = PlatformConnection::where('consumer_id', $consumer_id)->where('provider_id', $provider_id)->first();
166-
$platform_connection->state = $state;
167-
$platform_connection->save();
168-
return response()->json($platform_connection);
169-
} catch (\Exception) {
170-
return response()->json(['error' => 'Invalid request body'], 401);
171-
>>>>>>> 0feb532 (fix items in review with nokie. PR closes UN-102):middleware/app/Http/Controllers/PlatformConnectionController.php
17276
}
77+
return new PlatformConnectionResource($PlatformConnection->save());
17378
}
17479

17580
// Delete a platform connection
17681
// *************************************************************
177-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/PlatformConnectionController.php
17882
// DELETE: /api/v1/platform_connection/{request_body}
17983
// Request $req example:
18084
// { "consumer_id": 1, "provider_id": 1 }
@@ -186,26 +90,6 @@ public function delete(ShowPlatformConnectionRequest $req): \Illuminate\Http\Jso
18690
return response()->json(['success' => 'Platform connection deleted successfully'], 200);
18791
} catch (\Exception) {
18892
return response()->json(INVALID_REQUEST_BODY, 401);
189-
=======
190-
// DELETE: /api/platform_connection/{request_body}
191-
// Request $req example:
192-
// { "consumer_id": 1, "provider_id": 1 }
193-
// *************************************************************
194-
public function delete(Request $req): \Illuminate\Http\JsonResponse
195-
{
196-
try {
197-
$consumer_id = $req->input('consumer_id');
198-
$provider_id = $req->input('provider_id');
199-
} catch (\Exception) {
200-
return response()->json(['error' => 'Invalid request body'], 401);
201-
}
202-
try {
203-
$platform_connection = PlatformConnection::where('consumer_id', $consumer_id)->where('provider_id', $provider_id)->first();
204-
$platform_connection->delete();
205-
return response()->json(['status' => 'success']);
206-
} catch (\Exception) {
207-
return response()->json(['error' => 'Invalid request body'], 401);
208-
>>>>>>> 0feb532 (fix items in review with nokie. PR closes UN-102):middleware/app/Http/Controllers/PlatformConnectionController.php
20993
}
21094
}
21195
}

app/Http/Controllers/Api/V1/ProviderPlatformController.php

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
<<<<<<< HEAD:app/Http/Controllers/Api/V1/ProviderPlatformController.php
43
namespace App\Http\Controllers\Api\V1;
54

65
use App\Models\ProviderPlatform;
@@ -17,20 +16,20 @@ class ProviderPlatformController extends Controller
1716
// ****************************************************
1817
// GET: /api/provider_platforms/
1918
// ****************************************************
20-
public function index()
19+
public function index(): \Illuminate\Http\Resources\Json\AnonymousResourceCollection
2120
{
2221
return ProviderPlatformResource::collection(ProviderPlatform::all(['*']));
2322
}
2423
//
2524
// List information on a specific provider platform
2625
// ****************************************************
27-
// GET: /api/provider_platforms/{request_body}
26+
// GET: /api/v1/provider_platforms/{request_body}
2827
// @param Request $request
2928
// @return JsonResponse
3029
// ****************************************************
31-
public function show(ShowProviderPlatformRequest $request, $id): ProviderPlatformResource|\Illuminate\Http\JsonResponse
30+
public function show(ShowProviderPlatformRequest $request): ProviderPlatformResource|\Illuminate\Http\JsonResponse
3231
{
33-
$providerPlatform = ProviderPlatform::where('id', $id)->first();
32+
$providerPlatform = ProviderPlatform::where('id', $request->id)->first();
3433
if ($providerPlatform) {
3534
return new ProviderPlatformResource($providerPlatform);
3635
} else {
@@ -61,7 +60,7 @@ public function store(StoreProviderPlatformRequest $req): ProviderPlatformResour
6160
// @return JsonResponse
6261
// Request $request
6362
// ****************************************************
64-
public function update(StoreProviderPlatformRequest $request)
63+
public function update(StoreProviderPlatformRequest $request): ProviderPlatformResource|\Illuminate\Http\JsonResponse
6564
{
6665
$validated = $request->validated();
6766
$providerPlatform = ProviderPlatform::where($validated)->first();
@@ -79,23 +78,14 @@ public function update(StoreProviderPlatformRequest $request)
7978
// Request $req example:
8079
// { "provider_id": 1 }
8180
// ****************************************************
82-
public function destroy(Request $request, $providerId): \Illuminate\Http\JsonResponse
81+
public function destroy(Request $request): \Illuminate\Http\JsonResponse
8382
{
84-
$providerPlatform = ProviderPlatform::where('id', $providerId)->first();
83+
$providerPlatform = ProviderPlatform::where('id', $request->input('id'))->first();
8584
if (!$providerPlatform) {
8685
return response()->json(['error' => 'Invalid provider ID'], 401);
8786
} else {
8887
$providerPlatform->delete();
8988
return response()->json(json_encode($providerPlatform));
9089
}
9190
}
92-
=======
93-
namespace App\Http\Controllers;
94-
95-
use Illuminate\Http\Request;
96-
97-
class ProviderPlatformController extends Controller
98-
{
99-
//
100-
>>>>>>> 8b2e792 (fix: upgraded to meet schema):middleware/app/Http/Controllers/ProviderPlatformController.php
10191
}

0 commit comments

Comments
 (0)