From 2cca805adfe6b91a61e07ebdd10f4216e0201e36 Mon Sep 17 00:00:00 2001 From: Jeremy Postlethwaite Date: Wed, 29 Nov 2023 22:09:45 -0800 Subject: [PATCH] PG-25 --- .github/workflows/ci.yml | 2 +- ...1_02_100001_create_matrix_boards_table.php | 1 + ...01_02_100001_create_matrix_epics_table.php | 1 + routes/backlogs.php | 2 +- routes/boards.php | 2 +- routes/epics.php | 2 +- routes/flows.php | 2 +- routes/milestones.php | 2 +- routes/notes.php | 2 +- routes/projects.php | 2 +- routes/releases.php | 2 +- routes/roadmaps.php | 2 +- routes/sources.php | 2 +- routes/sprints.php | 2 +- routes/tags.php | 2 +- routes/teams.php | 2 +- routes/tickets.php | 2 +- routes/versions.php | 2 +- src/Http/Controllers/BacklogController.php | 41 ++++++++-------- src/Http/Controllers/BoardController.php | 40 +++++++-------- src/Http/Controllers/EpicController.php | 40 +++++++-------- src/Http/Controllers/FlowController.php | 40 +++++++-------- src/Http/Controllers/MilestoneController.php | 40 +++++++-------- src/Http/Controllers/NoteController.php | 40 +++++++-------- src/Http/Controllers/ProjectController.php | 40 +++++++-------- src/Http/Controllers/ReleaseController.php | 40 +++++++-------- src/Http/Controllers/RoadmapController.php | 40 +++++++-------- src/Http/Controllers/SourceController.php | 40 +++++++-------- src/Http/Controllers/SprintController.php | 40 +++++++-------- src/Http/Controllers/TagController.php | 38 +++++++------- src/Http/Controllers/TeamController.php | 40 +++++++-------- src/Http/Controllers/TicketController.php | 40 +++++++-------- src/Http/Controllers/VersionController.php | 40 +++++++-------- src/Http/Resources/Backlog.php | 5 +- src/Http/Resources/BacklogCollection.php | 12 +++-- src/Http/Resources/Board.php | 5 +- src/Http/Resources/BoardCollection.php | 12 +++-- src/Http/Resources/Epic.php | 5 +- src/Http/Resources/EpicCollection.php | 12 +++-- src/Http/Resources/Flow.php | 5 +- src/Http/Resources/FlowCollection.php | 12 +++-- src/Http/Resources/Milestone.php | 5 +- src/Http/Resources/MilestoneCollection.php | 12 +++-- src/Http/Resources/Note.php | 5 +- src/Http/Resources/NoteCollection.php | 12 +++-- src/Http/Resources/Project.php | 5 +- src/Http/Resources/ProjectCollection.php | 12 +++-- src/Http/Resources/Release.php | 5 +- src/Http/Resources/ReleaseCollection.php | 12 +++-- src/Http/Resources/Roadmap.php | 5 +- src/Http/Resources/RoadmapCollection.php | 12 +++-- src/Http/Resources/Source.php | 5 +- src/Http/Resources/SourceCollection.php | 12 +++-- src/Http/Resources/Sprint.php | 5 +- src/Http/Resources/SprintCollection.php | 12 +++-- src/Http/Resources/Tag.php | 5 +- src/Http/Resources/TagCollection.php | 12 +++-- src/Http/Resources/Team.php | 5 +- src/Http/Resources/TeamCollection.php | 12 +++-- src/Http/Resources/Ticket.php | 5 +- src/Http/Resources/TicketCollection.php | 12 +++-- src/Http/Resources/Version.php | 5 +- src/Http/Resources/VersionCollection.php | 12 +++-- .../Http/Controllers/BacklogRouteTest.php | 17 +------ .../Http/Controllers/BoardRouteTest.php | 17 +------ .../Http/Controllers/EpicRouteTest.php | 17 +------ .../Http/Controllers/FlowRouteTest.php | 49 +++++++------------ .../Http/Controllers/MilestoneRouteTest.php | 19 ++----- .../Http/Controllers/NoteRouteTest.php | 47 +++++++----------- .../Http/Controllers/ProjectRouteTest.php | 19 ++----- .../Http/Controllers/ReleaseRouteTest.php | 19 ++----- .../Http/Controllers/RoadmapRouteTest.php | 19 ++----- .../Http/Controllers/SourceRouteTest.php | 19 ++----- .../Http/Controllers/SprintRouteTest.php | 19 ++----- .../Feature/Http/Controllers/TagRouteTest.php | 19 ++----- .../Http/Controllers/TeamRouteTest.php | 19 ++----- .../Http/Controllers/TicketRouteTest.php | 19 ++----- .../Http/Controllers/VersionRouteTest.php | 19 ++----- 78 files changed, 554 insertions(+), 671 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14bfe5b..0bb5f59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: report: clover.xml coverage_badge_path: output/coverage.svg push_badge: false - - name: Git push to image-data branch + - name: Git push to testing/develop branch uses: peaceiris/actions-gh-pages@v3 with: publish_dir: ./output diff --git a/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_boards_table.php b/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_boards_table.php index e59e436..559b4c4 100644 --- a/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_boards_table.php +++ b/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_boards_table.php @@ -26,6 +26,7 @@ public function up(): void $table->uuid('owned_by_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); $table->string('board_type')->nullable()->index(); + $table->uuid('backlog_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); diff --git a/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_epics_table.php b/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_epics_table.php index 438902c..e3bf086 100644 --- a/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_epics_table.php +++ b/database/migrations-matrix-uuid/2020_01_02_100001_create_matrix_epics_table.php @@ -26,6 +26,7 @@ public function up(): void $table->uuid('owned_by_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); $table->string('epic_type')->nullable()->index(); + $table->uuid('backlog_id')->nullable()->index(); $table->uuid('board_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); diff --git a/routes/backlogs.php b/routes/backlogs.php index f63abc7..e9f18c6 100644 --- a/routes/backlogs.php +++ b/routes/backlogs.php @@ -65,7 +65,7 @@ ->can('lock', 'backlog') ; - Route::put('/unlock/{backlog}', [ + Route::delete('/lock/{backlog}', [ 'as' => 'playground.matrix.resource.backlogs.unlock', 'uses' => 'BacklogController@unlock', ])->whereUuid('backlog') diff --git a/routes/boards.php b/routes/boards.php index c7191a7..673715e 100644 --- a/routes/boards.php +++ b/routes/boards.php @@ -65,7 +65,7 @@ ->can('lock', 'board') ; - Route::put('/unlock/{board}', [ + Route::delete('/lock/{board}', [ 'as' => 'playground.matrix.resource.boards.unlock', 'uses' => 'BoardController@unlock', ])->whereUuid('board') diff --git a/routes/epics.php b/routes/epics.php index 1ab22df..e1891f9 100644 --- a/routes/epics.php +++ b/routes/epics.php @@ -65,7 +65,7 @@ ->can('lock', 'epic') ; - Route::put('/unlock/{epic}', [ + Route::delete('/lock/{epic}', [ 'as' => 'playground.matrix.resource.epics.unlock', 'uses' => 'EpicController@unlock', ])->whereUuid('epic') diff --git a/routes/flows.php b/routes/flows.php index 88c65de..3f56ca5 100644 --- a/routes/flows.php +++ b/routes/flows.php @@ -65,7 +65,7 @@ ->can('lock', 'flow') ; - Route::put('/unlock/{flow}', [ + Route::delete('/lock/{flow}', [ 'as' => 'playground.matrix.resource.flows.unlock', 'uses' => 'FlowController@unlock', ])->whereUuid('flow') diff --git a/routes/milestones.php b/routes/milestones.php index 9414f12..87d52ca 100644 --- a/routes/milestones.php +++ b/routes/milestones.php @@ -65,7 +65,7 @@ ->can('lock', 'milestone') ; - Route::put('/unlock/{milestone}', [ + Route::delete('/lock/{milestone}', [ 'as' => 'playground.matrix.resource.milestones.unlock', 'uses' => 'MilestoneController@unlock', ])->whereUuid('milestone') diff --git a/routes/notes.php b/routes/notes.php index 3639470..26979c0 100644 --- a/routes/notes.php +++ b/routes/notes.php @@ -65,7 +65,7 @@ ->can('lock', 'note') ; - Route::put('/unlock/{note}', [ + Route::delete('/lock/{note}', [ 'as' => 'playground.matrix.resource.notes.unlock', 'uses' => 'NoteController@unlock', ])->whereUuid('note') diff --git a/routes/projects.php b/routes/projects.php index c589e08..6acac2d 100644 --- a/routes/projects.php +++ b/routes/projects.php @@ -65,7 +65,7 @@ ->can('lock', 'project') ; - Route::put('/unlock/{project}', [ + Route::delete('/lock/{project}', [ 'as' => 'playground.matrix.resource.projects.unlock', 'uses' => 'ProjectController@unlock', ])->whereUuid('project') diff --git a/routes/releases.php b/routes/releases.php index 1db6416..ada8f15 100644 --- a/routes/releases.php +++ b/routes/releases.php @@ -65,7 +65,7 @@ ->can('lock', 'release') ; - Route::put('/unlock/{release}', [ + Route::delete('/lock/{release}', [ 'as' => 'playground.matrix.resource.releases.unlock', 'uses' => 'ReleaseController@unlock', ])->whereUuid('release') diff --git a/routes/roadmaps.php b/routes/roadmaps.php index 456a69e..b884138 100644 --- a/routes/roadmaps.php +++ b/routes/roadmaps.php @@ -65,7 +65,7 @@ ->can('lock', 'roadmap') ; - Route::put('/unlock/{roadmap}', [ + Route::delete('/lock/{roadmap}', [ 'as' => 'playground.matrix.resource.roadmaps.unlock', 'uses' => 'RoadmapController@unlock', ])->whereUuid('roadmap') diff --git a/routes/sources.php b/routes/sources.php index 1f304ef..b22874e 100644 --- a/routes/sources.php +++ b/routes/sources.php @@ -65,7 +65,7 @@ ->can('lock', 'source') ; - Route::put('/unlock/{source}', [ + Route::delete('/lock/{source}', [ 'as' => 'playground.matrix.resource.sources.unlock', 'uses' => 'SourceController@unlock', ])->whereUuid('source') diff --git a/routes/sprints.php b/routes/sprints.php index 24c0c45..ed7bf06 100644 --- a/routes/sprints.php +++ b/routes/sprints.php @@ -65,7 +65,7 @@ ->can('lock', 'sprint') ; - Route::put('/unlock/{sprint}', [ + Route::delete('/lock/{sprint}', [ 'as' => 'playground.matrix.resource.sprints.unlock', 'uses' => 'SprintController@unlock', ])->whereUuid('sprint') diff --git a/routes/tags.php b/routes/tags.php index 6acd7f5..7795828 100644 --- a/routes/tags.php +++ b/routes/tags.php @@ -65,7 +65,7 @@ ->can('lock', 'tag') ; - Route::put('/unlock/{tag}', [ + Route::delete('/lock/{tag}', [ 'as' => 'playground.matrix.resource.tags.unlock', 'uses' => 'TagController@unlock', ])->whereUuid('tag') diff --git a/routes/teams.php b/routes/teams.php index 4c9a315..437ef49 100644 --- a/routes/teams.php +++ b/routes/teams.php @@ -65,7 +65,7 @@ ->can('lock', 'team') ; - Route::put('/unlock/{team}', [ + Route::delete('/lock/{team}', [ 'as' => 'playground.matrix.resource.teams.unlock', 'uses' => 'TeamController@unlock', ])->whereUuid('team') diff --git a/routes/tickets.php b/routes/tickets.php index 2b25da6..ce76b39 100644 --- a/routes/tickets.php +++ b/routes/tickets.php @@ -65,7 +65,7 @@ ->can('lock', 'ticket') ; - Route::put('/unlock/{ticket}', [ + Route::delete('/lock/{ticket}', [ 'as' => 'playground.matrix.resource.tickets.unlock', 'uses' => 'TicketController@unlock', ])->whereUuid('ticket') diff --git a/routes/versions.php b/routes/versions.php index 462d736..cb8677b 100644 --- a/routes/versions.php +++ b/routes/versions.php @@ -65,7 +65,7 @@ ->can('lock', 'version') ; - Route::put('/unlock/{version}', [ + Route::delete('/lock/{version}', [ 'as' => 'playground.matrix.resource.versions.unlock', 'uses' => 'VersionController@unlock', ])->whereUuid('version') diff --git a/src/Http/Controllers/BacklogController.php b/src/Http/Controllers/BacklogController.php index 8d496d8..09c91da 100644 --- a/src/Http/Controllers/BacklogController.php +++ b/src/Http/Controllers/BacklogController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Backlog\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Backlog\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Backlog\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Backlog\Backlog as BacklogResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Backlog\BacklogCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Backlog as BacklogResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\BacklogCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -62,7 +62,7 @@ public function create( $backlog = new Backlog($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -113,7 +113,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $backlog->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -186,7 +186,7 @@ public function destroy( public function lock( Backlog $backlog, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BacklogResource { $validated = $request->validated(); $user = $request->user(); @@ -196,14 +196,15 @@ public function lock( $backlog->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $backlog->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; + // dump($request); if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -261,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new BacklogCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -298,7 +299,7 @@ public function index( public function restore( Backlog $backlog, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BacklogResource { $validated = $request->validated(); $user = $request->user(); @@ -306,7 +307,7 @@ public function restore( $backlog->restore(); if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -326,13 +327,13 @@ public function restore( public function show( Backlog $backlog, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|BacklogResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $backlog->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -340,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $meta['input'] = $request->input(); @@ -364,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|BacklogResource { $validated = $request->validated(); $user = $request->user(); @@ -374,7 +375,7 @@ public function store( $backlog->save(); if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -394,7 +395,7 @@ public function store( public function unlock( Backlog $backlog, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BacklogResource { $validated = $request->validated(); $user = $request->user(); @@ -404,7 +405,7 @@ public function unlock( $backlog->save(); if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -424,7 +425,7 @@ public function unlock( public function update( Backlog $backlog, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BacklogResource { $validated = $request->validated(); $user = $request->user(); @@ -432,7 +433,7 @@ public function update( $backlog->update($validated); if ($request->expectsJson()) { - return new BacklogResource($backlog); + return (new BacklogResource($backlog))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/BoardController.php b/src/Http/Controllers/BoardController.php index 4676d66..2b27899 100644 --- a/src/Http/Controllers/BoardController.php +++ b/src/Http/Controllers/BoardController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Board\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Board\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Board\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Board\Board as BoardResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Board\BoardCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Board as BoardResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\BoardCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $board = new Board($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $board->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Board $board, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BoardResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $board->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $board->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new BoardCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Board $board, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BoardResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $board->restore(); if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Board $board, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|BoardResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $board->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|BoardResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $board->save(); if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Board $board, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BoardResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $board->save(); if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Board $board, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|BoardResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $board->update($validated); if ($request->expectsJson()) { - return new BoardResource($board); + return (new BoardResource($board))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/EpicController.php b/src/Http/Controllers/EpicController.php index fc5f6ff..a06f784 100644 --- a/src/Http/Controllers/EpicController.php +++ b/src/Http/Controllers/EpicController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Epic\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Epic\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Epic\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Epic\Epic as EpicResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Epic\EpicCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Epic as EpicResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\EpicCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $epic = new Epic($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $epic->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Epic $epic, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|EpicResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $epic->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $epic->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new EpicCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Epic $epic, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|EpicResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $epic->restore(); if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Epic $epic, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|EpicResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $epic->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|EpicResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $epic->save(); if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Epic $epic, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|EpicResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $epic->save(); if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Epic $epic, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|EpicResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $epic->update($validated); if ($request->expectsJson()) { - return new EpicResource($epic); + return (new EpicResource($epic))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/FlowController.php b/src/Http/Controllers/FlowController.php index e5e72da..8ba2942 100644 --- a/src/Http/Controllers/FlowController.php +++ b/src/Http/Controllers/FlowController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Flow\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Flow\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Flow\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Flow\Flow as FlowResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Flow\FlowCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Flow as FlowResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\FlowCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $flow = new Flow($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $flow->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Flow $flow, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|FlowResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $flow->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $flow->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new FlowCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Flow $flow, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|FlowResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $flow->restore(); if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Flow $flow, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|FlowResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $flow->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|FlowResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $flow->save(); if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Flow $flow, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|FlowResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $flow->save(); if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Flow $flow, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|FlowResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $flow->update($validated); if ($request->expectsJson()) { - return new FlowResource($flow); + return (new FlowResource($flow))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/MilestoneController.php b/src/Http/Controllers/MilestoneController.php index e10ad8a..be16abc 100644 --- a/src/Http/Controllers/MilestoneController.php +++ b/src/Http/Controllers/MilestoneController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Milestone\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Milestone\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Milestone\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Milestone\Milestone as MilestoneResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Milestone\MilestoneCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Milestone as MilestoneResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\MilestoneCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $milestone = new Milestone($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $milestone->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Milestone $milestone, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|MilestoneResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $milestone->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $milestone->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new MilestoneCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Milestone $milestone, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|MilestoneResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $milestone->restore(); if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Milestone $milestone, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|MilestoneResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $milestone->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|MilestoneResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $milestone->save(); if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Milestone $milestone, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|MilestoneResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $milestone->save(); if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Milestone $milestone, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|MilestoneResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $milestone->update($validated); if ($request->expectsJson()) { - return new MilestoneResource($milestone); + return (new MilestoneResource($milestone))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/NoteController.php b/src/Http/Controllers/NoteController.php index 7de43c2..3de9dea 100644 --- a/src/Http/Controllers/NoteController.php +++ b/src/Http/Controllers/NoteController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Note\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Note\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Note\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Note\Note as NoteResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Note\NoteCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Note as NoteResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\NoteCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $note = new Note($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $note->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Note $note, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|NoteResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $note->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $note->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new NoteCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Note $note, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|NoteResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $note->restore(); if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Note $note, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|NoteResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $note->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|NoteResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $note->save(); if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Note $note, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|NoteResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $note->save(); if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Note $note, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|NoteResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $note->update($validated); if ($request->expectsJson()) { - return new NoteResource($note); + return (new NoteResource($note))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/ProjectController.php b/src/Http/Controllers/ProjectController.php index fa4209d..f156f34 100644 --- a/src/Http/Controllers/ProjectController.php +++ b/src/Http/Controllers/ProjectController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Project\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Project\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Project\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Project\Project as ProjectResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Project\ProjectCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Project as ProjectResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\ProjectCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $project = new Project($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $project->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Project $project, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ProjectResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $project->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $project->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new ProjectCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Project $project, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ProjectResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $project->restore(); if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Project $project, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|ProjectResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $project->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|ProjectResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $project->save(); if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Project $project, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ProjectResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $project->save(); if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Project $project, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ProjectResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $project->update($validated); if ($request->expectsJson()) { - return new ProjectResource($project); + return (new ProjectResource($project))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/ReleaseController.php b/src/Http/Controllers/ReleaseController.php index 6ec1572..aa91880 100644 --- a/src/Http/Controllers/ReleaseController.php +++ b/src/Http/Controllers/ReleaseController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Release\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Release\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Release\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Release\Release as ReleaseResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Release\ReleaseCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Release as ReleaseResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\ReleaseCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $release = new Release($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $release->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Release $release, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ReleaseResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $release->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $release->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new ReleaseCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Release $release, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ReleaseResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $release->restore(); if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Release $release, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|ReleaseResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $release->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|ReleaseResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $release->save(); if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Release $release, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ReleaseResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $release->save(); if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Release $release, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|ReleaseResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $release->update($validated); if ($request->expectsJson()) { - return new ReleaseResource($release); + return (new ReleaseResource($release))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/RoadmapController.php b/src/Http/Controllers/RoadmapController.php index c810760..f217b97 100644 --- a/src/Http/Controllers/RoadmapController.php +++ b/src/Http/Controllers/RoadmapController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Roadmap\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Roadmap\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Roadmap\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Roadmap\Roadmap as RoadmapResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Roadmap\RoadmapCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Roadmap as RoadmapResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\RoadmapCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $roadmap = new Roadmap($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $roadmap->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Roadmap $roadmap, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|RoadmapResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $roadmap->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $roadmap->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new RoadmapCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Roadmap $roadmap, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|RoadmapResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $roadmap->restore(); if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Roadmap $roadmap, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|RoadmapResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $roadmap->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|RoadmapResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $roadmap->save(); if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Roadmap $roadmap, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|RoadmapResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $roadmap->save(); if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Roadmap $roadmap, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|RoadmapResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $roadmap->update($validated); if ($request->expectsJson()) { - return new RoadmapResource($roadmap); + return (new RoadmapResource($roadmap))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/SourceController.php b/src/Http/Controllers/SourceController.php index 96d9efd..5f4210b 100644 --- a/src/Http/Controllers/SourceController.php +++ b/src/Http/Controllers/SourceController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Source\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Source\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Source\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Source\Source as SourceResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Source\SourceCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Source as SourceResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\SourceCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $source = new Source($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $source->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Source $source, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SourceResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $source->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $source->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new SourceCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Source $source, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SourceResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $source->restore(); if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Source $source, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|SourceResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $source->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|SourceResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $source->save(); if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Source $source, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SourceResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $source->save(); if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Source $source, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SourceResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $source->update($validated); if ($request->expectsJson()) { - return new SourceResource($source); + return (new SourceResource($source))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/SprintController.php b/src/Http/Controllers/SprintController.php index 6ec0eab..1424877 100644 --- a/src/Http/Controllers/SprintController.php +++ b/src/Http/Controllers/SprintController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Sprint\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Sprint\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Sprint\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Sprint\Sprint as SprintResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Sprint\SprintCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Sprint as SprintResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\SprintCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $sprint = new Sprint($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $sprint->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Sprint $sprint, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SprintResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $sprint->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $sprint->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new SprintCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Sprint $sprint, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SprintResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $sprint->restore(); if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Sprint $sprint, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|SprintResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $sprint->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|SprintResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $sprint->save(); if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Sprint $sprint, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SprintResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $sprint->save(); if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Sprint $sprint, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|SprintResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $sprint->update($validated); if ($request->expectsJson()) { - return new SprintResource($sprint); + return (new SprintResource($sprint))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/TagController.php b/src/Http/Controllers/TagController.php index a7cee89..b7d1f64 100644 --- a/src/Http/Controllers/TagController.php +++ b/src/Http/Controllers/TagController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Tag\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Tag\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Tag\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Tag\Tag as TagResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Tag\TagCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Tag as TagResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\TagCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $tag = new Tag($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $tag->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Tag $tag, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TagResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $tag->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $tag->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new TagResource($tag); + return (new TagResource($tag))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new TagCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Tag $tag, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TagResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $tag->restore(); if ($request->expectsJson()) { - return new TagResource($tag); + return (new TagResource($tag))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Tag $tag, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|TagResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $tag->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|TagResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $tag->save(); if ($request->expectsJson()) { - return new TagResource($tag); + return (new TagResource($tag))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Tag $tag, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TagResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $tag->save(); if ($request->expectsJson()) { - return new TagResource($tag); + return (new TagResource($tag))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Tag $tag, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TagResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $tag->update($validated); if ($request->expectsJson()) { - return new TagResource($tag); + return (new TagResource($tag))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/TeamController.php b/src/Http/Controllers/TeamController.php index ead0b9b..2c4d886 100644 --- a/src/Http/Controllers/TeamController.php +++ b/src/Http/Controllers/TeamController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Team\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Team\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Team\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Team\Team as TeamResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Team\TeamCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Team as TeamResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\TeamCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $team = new Team($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $team->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Team $team, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TeamResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $team->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $team->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new TeamCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Team $team, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TeamResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $team->restore(); if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Team $team, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|TeamResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $team->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|TeamResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $team->save(); if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Team $team, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TeamResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $team->save(); if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Team $team, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TeamResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $team->update($validated); if ($request->expectsJson()) { - return new TeamResource($team); + return (new TeamResource($team))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/TicketController.php b/src/Http/Controllers/TicketController.php index 6b87197..9f94675 100644 --- a/src/Http/Controllers/TicketController.php +++ b/src/Http/Controllers/TicketController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Ticket\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Ticket\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Ticket\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Ticket\Ticket as TicketResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Ticket\TicketCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Ticket as TicketResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\TicketCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $ticket = new Ticket($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $ticket->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Ticket $ticket, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TicketResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $ticket->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $ticket->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new TicketCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Ticket $ticket, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TicketResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $ticket->restore(); if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Ticket $ticket, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|TicketResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $ticket->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|TicketResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $ticket->save(); if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Ticket $ticket, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TicketResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $ticket->save(); if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Ticket $ticket, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|TicketResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $ticket->update($validated); if ($request->expectsJson()) { - return new TicketResource($ticket); + return (new TicketResource($ticket))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Controllers/VersionController.php b/src/Http/Controllers/VersionController.php index 3c92004..973032f 100644 --- a/src/Http/Controllers/VersionController.php +++ b/src/Http/Controllers/VersionController.php @@ -17,8 +17,8 @@ use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Version\StoreRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Version\UnlockRequest; use GammaMatrix\Playground\Matrix\Resource\Http\Requests\Version\UpdateRequest; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Version\Version as VersionResource; -use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Version\VersionCollection; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\Version as VersionResource; +use GammaMatrix\Playground\Matrix\Resource\Http\Resources\VersionCollection; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Resources\Json\JsonResource; @@ -63,7 +63,7 @@ public function create( $version = new Version($validated); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => null, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -114,7 +114,7 @@ public function edit( $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $version->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -187,7 +187,7 @@ public function destroy( public function lock( Version $version, LockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|VersionResource { $validated = $request->validated(); $user = $request->user(); @@ -197,14 +197,14 @@ public function lock( $version->save(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $version->id, 'timestamp' => Carbon::now()->toJson(), 'info' => $this->packageInfo, ]; if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -262,13 +262,13 @@ public function index( if ($request->expectsJson()) { return (new VersionCollection($paginator))->additional(['meta' => [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'validated' => $validated, ]]); } $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'columns' => $request->getPaginationColumns(), 'dates' => $request->getPaginationDates(), 'flags' => $request->getPaginationFlags(), @@ -299,7 +299,7 @@ public function index( public function restore( Version $version, RestoreRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|VersionResource { $validated = $request->validated(); $user = $request->user(); @@ -307,7 +307,7 @@ public function restore( $version->restore(); if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $returnUrl = $validated['_return_url'] ?? ''; @@ -327,13 +327,13 @@ public function restore( public function show( Version $version, ShowRequest $request - ): JsonResponse|View { + ): JsonResponse|View|VersionResource { $validated = $request->validated(); $user = $request->user(); $meta = [ - 'session_user_id' => $user->id, + 'session_user_id' => $user?->id, 'id' => $version->id, 'timestamp' => Carbon::now()->toJson(), 'validated' => $validated, @@ -341,7 +341,7 @@ public function show( ]; if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $meta['input'] = $request->input(); @@ -365,7 +365,7 @@ public function show( */ public function store( StoreRequest $request - ): Response|JsonResponse|RedirectResponse { + ): Response|JsonResponse|RedirectResponse|VersionResource { $validated = $request->validated(); $user = $request->user(); @@ -375,7 +375,7 @@ public function store( $version->save(); if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -395,7 +395,7 @@ public function store( public function unlock( Version $version, UnlockRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|VersionResource { $validated = $request->validated(); $user = $request->user(); @@ -405,7 +405,7 @@ public function unlock( $version->save(); if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $returnUrl = $validated['return_url'] ?? ''; @@ -425,7 +425,7 @@ public function unlock( public function update( Version $version, UpdateRequest $request - ): JsonResponse|RedirectResponse { + ): JsonResponse|RedirectResponse|VersionResource { $validated = $request->validated(); $user = $request->user(); @@ -433,7 +433,7 @@ public function update( $version->update($validated); if ($request->expectsJson()) { - return new VersionResource($version); + return (new VersionResource($version))->response($request); } $returnUrl = $validated['return_url'] ?? ''; diff --git a/src/Http/Resources/Backlog.php b/src/Http/Resources/Backlog.php index 1abc24e..9c99572 100644 --- a/src/Http/Resources/Backlog.php +++ b/src/Http/Resources/Backlog.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->backlog?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/BacklogCollection.php b/src/Http/Resources/BacklogCollection.php index 2a99ed4..b10a623 100644 --- a/src/Http/Resources/BacklogCollection.php +++ b/src/Http/Resources/BacklogCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Board.php b/src/Http/Resources/Board.php index bd5eaae..7b16f98 100644 --- a/src/Http/Resources/Board.php +++ b/src/Http/Resources/Board.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->board?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/BoardCollection.php b/src/Http/Resources/BoardCollection.php index 341a864..e6ee489 100644 --- a/src/Http/Resources/BoardCollection.php +++ b/src/Http/Resources/BoardCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Epic.php b/src/Http/Resources/Epic.php index 412bd0b..f5703ca 100644 --- a/src/Http/Resources/Epic.php +++ b/src/Http/Resources/Epic.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->epic?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/EpicCollection.php b/src/Http/Resources/EpicCollection.php index bed5346..c1297d0 100644 --- a/src/Http/Resources/EpicCollection.php +++ b/src/Http/Resources/EpicCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Flow.php b/src/Http/Resources/Flow.php index 7dbc111..3248ffd 100644 --- a/src/Http/Resources/Flow.php +++ b/src/Http/Resources/Flow.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->flow?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/FlowCollection.php b/src/Http/Resources/FlowCollection.php index 2e6bea3..e982da3 100644 --- a/src/Http/Resources/FlowCollection.php +++ b/src/Http/Resources/FlowCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Milestone.php b/src/Http/Resources/Milestone.php index 57556ea..6e1baf9 100644 --- a/src/Http/Resources/Milestone.php +++ b/src/Http/Resources/Milestone.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->milestone?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/MilestoneCollection.php b/src/Http/Resources/MilestoneCollection.php index 6d4a400..ec3e06d 100644 --- a/src/Http/Resources/MilestoneCollection.php +++ b/src/Http/Resources/MilestoneCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Note.php b/src/Http/Resources/Note.php index 8a66717..ad924ed 100644 --- a/src/Http/Resources/Note.php +++ b/src/Http/Resources/Note.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->note?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/NoteCollection.php b/src/Http/Resources/NoteCollection.php index fcb8ed7..75bd161 100644 --- a/src/Http/Resources/NoteCollection.php +++ b/src/Http/Resources/NoteCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Project.php b/src/Http/Resources/Project.php index 8cb00a0..2391b9e 100644 --- a/src/Http/Resources/Project.php +++ b/src/Http/Resources/Project.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->project?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/ProjectCollection.php b/src/Http/Resources/ProjectCollection.php index 5817d9a..88657b1 100644 --- a/src/Http/Resources/ProjectCollection.php +++ b/src/Http/Resources/ProjectCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Release.php b/src/Http/Resources/Release.php index 5ed050d..d177e4d 100644 --- a/src/Http/Resources/Release.php +++ b/src/Http/Resources/Release.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->release?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/ReleaseCollection.php b/src/Http/Resources/ReleaseCollection.php index 623042f..6e34738 100644 --- a/src/Http/Resources/ReleaseCollection.php +++ b/src/Http/Resources/ReleaseCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Roadmap.php b/src/Http/Resources/Roadmap.php index b9728b6..2703048 100644 --- a/src/Http/Resources/Roadmap.php +++ b/src/Http/Resources/Roadmap.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->roadmap?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/RoadmapCollection.php b/src/Http/Resources/RoadmapCollection.php index 265468d..d9dd2af 100644 --- a/src/Http/Resources/RoadmapCollection.php +++ b/src/Http/Resources/RoadmapCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Source.php b/src/Http/Resources/Source.php index bcd070b..7e26ca9 100644 --- a/src/Http/Resources/Source.php +++ b/src/Http/Resources/Source.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->source?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/SourceCollection.php b/src/Http/Resources/SourceCollection.php index 171f01c..3c7ad66 100644 --- a/src/Http/Resources/SourceCollection.php +++ b/src/Http/Resources/SourceCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Sprint.php b/src/Http/Resources/Sprint.php index 6bdad31..ca3f99d 100644 --- a/src/Http/Resources/Sprint.php +++ b/src/Http/Resources/Sprint.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->sprint?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/SprintCollection.php b/src/Http/Resources/SprintCollection.php index 7e230fe..28cbe48 100644 --- a/src/Http/Resources/SprintCollection.php +++ b/src/Http/Resources/SprintCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Tag.php b/src/Http/Resources/Tag.php index defeb66..624e1aa 100644 --- a/src/Http/Resources/Tag.php +++ b/src/Http/Resources/Tag.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->tag?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/TagCollection.php b/src/Http/Resources/TagCollection.php index 61f31e5..d1b9978 100644 --- a/src/Http/Resources/TagCollection.php +++ b/src/Http/Resources/TagCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Team.php b/src/Http/Resources/Team.php index 2a6460e..25fd6b0 100644 --- a/src/Http/Resources/Team.php +++ b/src/Http/Resources/Team.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->team?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/TeamCollection.php b/src/Http/Resources/TeamCollection.php index ee6fb8a..832c5b8 100644 --- a/src/Http/Resources/TeamCollection.php +++ b/src/Http/Resources/TeamCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Ticket.php b/src/Http/Resources/Ticket.php index 2b2b465..8a7ef1d 100644 --- a/src/Http/Resources/Ticket.php +++ b/src/Http/Resources/Ticket.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->ticket?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/TicketCollection.php b/src/Http/Resources/TicketCollection.php index b714361..f4dc05e 100644 --- a/src/Http/Resources/TicketCollection.php +++ b/src/Http/Resources/TicketCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/Version.php b/src/Http/Resources/Version.php index 2e0686f..376ed3b 100644 --- a/src/Http/Resources/Version.php +++ b/src/Http/Resources/Version.php @@ -27,8 +27,11 @@ public function with(Request $request): array { return [ 'meta' => [ - 'rules' => $request->rules(), + 'id' => $request?->version?->id, + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/src/Http/Resources/VersionCollection.php b/src/Http/Resources/VersionCollection.php index c35262c..0284dec 100644 --- a/src/Http/Resources/VersionCollection.php +++ b/src/Http/Resources/VersionCollection.php @@ -27,13 +27,15 @@ public function with(Request $request): array { return [ 'meta' => [ - 'columns' => $request->getPaginationColumns(), - 'dates' => $request->getPaginationDates(), - 'flags' => $request->getPaginationFlags(), - 'ids' => $request->getPaginationIds(), - 'rules' => $request->rules(), + 'columns' => $request->getPaginationColumns(), + 'dates' => $request->getPaginationDates(), + 'flags' => $request->getPaginationFlags(), + 'ids' => $request->getPaginationIds(), + 'rules' => $request->rules(), + 'session_user_id' => $request->user()->id, 'sortable' => $request->getSortable(), 'timestamp' => Carbon::now()->toJson(), + 'validated' => $request->validated(), ], ]; } diff --git a/tests/Feature/Http/Controllers/BacklogRouteTest.php b/tests/Feature/Http/Controllers/BacklogRouteTest.php index 4c56e35..9737c1d 100644 --- a/tests/Feature/Http/Controllers/BacklogRouteTest.php +++ b/tests/Feature/Http/Controllers/BacklogRouteTest.php @@ -17,6 +17,7 @@ class BacklogRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Backlog::class; @@ -130,23 +131,9 @@ class BacklogRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/BoardRouteTest.php b/tests/Feature/Http/Controllers/BoardRouteTest.php index 8400618..d38f2f5 100644 --- a/tests/Feature/Http/Controllers/BoardRouteTest.php +++ b/tests/Feature/Http/Controllers/BoardRouteTest.php @@ -17,6 +17,7 @@ class BoardRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Board::class; @@ -128,25 +129,11 @@ class BoardRouteTest extends TestCase ], 'meta' => [ 'id', + 'rules', 'session_user_id', 'timestamp', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/EpicRouteTest.php b/tests/Feature/Http/Controllers/EpicRouteTest.php index f81b7c0..68c004e 100644 --- a/tests/Feature/Http/Controllers/EpicRouteTest.php +++ b/tests/Feature/Http/Controllers/EpicRouteTest.php @@ -17,6 +17,7 @@ class EpicRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Epic::class; @@ -128,25 +129,11 @@ class EpicRouteTest extends TestCase ], 'meta' => [ 'id', + 'rules', 'session_user_id', 'timestamp', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/FlowRouteTest.php b/tests/Feature/Http/Controllers/FlowRouteTest.php index 76ab942..7237765 100644 --- a/tests/Feature/Http/Controllers/FlowRouteTest.php +++ b/tests/Feature/Http/Controllers/FlowRouteTest.php @@ -17,6 +17,7 @@ class FlowRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Flow::class; @@ -44,20 +45,20 @@ class FlowRouteTest extends TestCase 'owned_by_id', 'parent_id', 'flow_type', - 'backlog_id', - 'board_id', - 'epic_id', - 'milestone_id', + // 'backlog_id', + // 'board_id', + // 'epic_id', + // 'milestone_id', 'note_id', - 'project_id', - 'release_id', - 'roadmap_id', - 'source_id', - 'sprint_id', + // 'project_id', + // 'release_id', + // 'roadmap_id', + // 'source_id', + // 'sprint_id', 'tag_id', 'team_id', - 'ticket_id', - 'version_id', + // 'ticket_id', + // 'version_id', 'created_at', 'deleted_at', 'updated_at', @@ -68,12 +69,12 @@ class FlowRouteTest extends TestCase 'canceled_at', 'closed_at', 'embargo_at', - 'fixed_at', + // 'fixed_at', 'postponed_at', 'published_at', 'released_at', 'resumed_at', - 'resolved_at', + // 'resolved_at', 'suspended_at', 'gids', 'po', @@ -119,34 +120,20 @@ class FlowRouteTest extends TestCase 'ui', 'assets', 'flow', - 'board', + // 'board', 'flow', 'meta', 'options', - 'roadmap', - 'sources', + // 'roadmap', + // 'sources', ], 'meta' => [ 'id', + 'rules', 'session_user_id', 'timestamp', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/MilestoneRouteTest.php b/tests/Feature/Http/Controllers/MilestoneRouteTest.php index beba4bb..be45c11 100644 --- a/tests/Feature/Http/Controllers/MilestoneRouteTest.php +++ b/tests/Feature/Http/Controllers/MilestoneRouteTest.php @@ -17,6 +17,7 @@ class MilestoneRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Milestone::class; @@ -118,7 +119,7 @@ class MilestoneRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'milestone', + 'backlog', 'board', 'flow', 'meta', @@ -128,25 +129,11 @@ class MilestoneRouteTest extends TestCase ], 'meta' => [ 'id', + 'rules', 'session_user_id', 'timestamp', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/NoteRouteTest.php b/tests/Feature/Http/Controllers/NoteRouteTest.php index 8a65462..2f4f958 100644 --- a/tests/Feature/Http/Controllers/NoteRouteTest.php +++ b/tests/Feature/Http/Controllers/NoteRouteTest.php @@ -17,6 +17,7 @@ class NoteRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Note::class; @@ -44,20 +45,20 @@ class NoteRouteTest extends TestCase 'owned_by_id', 'parent_id', 'note_type', - 'backlog_id', - 'board_id', - 'epic_id', - 'flow_id', - 'milestone_id', - 'project_id', - 'release_id', - 'roadmap_id', - 'source_id', - 'sprint_id', - 'tag_id', - 'team_id', - 'ticket_id', - 'version_id', + // 'backlog_id', + // 'board_id', + // 'epic_id', + // 'flow_id', + // 'milestone_id', + // 'project_id', + // 'release_id', + // 'roadmap_id', + // 'source_id', + // 'sprint_id', + // 'tag_id', + // 'team_id', + // 'ticket_id', + // 'version_id', 'created_at', 'deleted_at', 'updated_at', @@ -118,7 +119,7 @@ class NoteRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'milestone', + 'backlog', 'board', 'flow', 'meta', @@ -128,25 +129,11 @@ class NoteRouteTest extends TestCase ], 'meta' => [ 'id', + 'rules', 'session_user_id', 'timestamp', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/ProjectRouteTest.php b/tests/Feature/Http/Controllers/ProjectRouteTest.php index 6323da7..a9fd8aa 100644 --- a/tests/Feature/Http/Controllers/ProjectRouteTest.php +++ b/tests/Feature/Http/Controllers/ProjectRouteTest.php @@ -17,6 +17,7 @@ class ProjectRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Project::class; @@ -118,7 +119,7 @@ class ProjectRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'project', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class ProjectRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/ReleaseRouteTest.php b/tests/Feature/Http/Controllers/ReleaseRouteTest.php index 66b0ba2..ab0500f 100644 --- a/tests/Feature/Http/Controllers/ReleaseRouteTest.php +++ b/tests/Feature/Http/Controllers/ReleaseRouteTest.php @@ -17,6 +17,7 @@ class ReleaseRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Release::class; @@ -118,7 +119,7 @@ class ReleaseRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'release', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class ReleaseRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/RoadmapRouteTest.php b/tests/Feature/Http/Controllers/RoadmapRouteTest.php index 17c1322..b3dec55 100644 --- a/tests/Feature/Http/Controllers/RoadmapRouteTest.php +++ b/tests/Feature/Http/Controllers/RoadmapRouteTest.php @@ -17,6 +17,7 @@ class RoadmapRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Roadmap::class; @@ -118,7 +119,7 @@ class RoadmapRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'roadmap', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class RoadmapRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/SourceRouteTest.php b/tests/Feature/Http/Controllers/SourceRouteTest.php index 172b3cc..add5ada 100644 --- a/tests/Feature/Http/Controllers/SourceRouteTest.php +++ b/tests/Feature/Http/Controllers/SourceRouteTest.php @@ -17,6 +17,7 @@ class SourceRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Source::class; @@ -118,7 +119,7 @@ class SourceRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'source', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class SourceRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/SprintRouteTest.php b/tests/Feature/Http/Controllers/SprintRouteTest.php index fddd216..03dcc32 100644 --- a/tests/Feature/Http/Controllers/SprintRouteTest.php +++ b/tests/Feature/Http/Controllers/SprintRouteTest.php @@ -17,6 +17,7 @@ class SprintRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Sprint::class; @@ -118,7 +119,7 @@ class SprintRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'sprint', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class SprintRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/TagRouteTest.php b/tests/Feature/Http/Controllers/TagRouteTest.php index e446938..7dddd89 100644 --- a/tests/Feature/Http/Controllers/TagRouteTest.php +++ b/tests/Feature/Http/Controllers/TagRouteTest.php @@ -17,6 +17,7 @@ class TagRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Tag::class; @@ -118,7 +119,7 @@ class TagRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'tag', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class TagRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/TeamRouteTest.php b/tests/Feature/Http/Controllers/TeamRouteTest.php index 985c1a0..2217224 100644 --- a/tests/Feature/Http/Controllers/TeamRouteTest.php +++ b/tests/Feature/Http/Controllers/TeamRouteTest.php @@ -17,6 +17,7 @@ class TeamRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Team::class; @@ -118,7 +119,7 @@ class TeamRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'team', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class TeamRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/TicketRouteTest.php b/tests/Feature/Http/Controllers/TicketRouteTest.php index 2bbd737..d4f3d94 100644 --- a/tests/Feature/Http/Controllers/TicketRouteTest.php +++ b/tests/Feature/Http/Controllers/TicketRouteTest.php @@ -17,6 +17,7 @@ class TicketRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Ticket::class; @@ -118,7 +119,7 @@ class TicketRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'ticket', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class TicketRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [ diff --git a/tests/Feature/Http/Controllers/VersionRouteTest.php b/tests/Feature/Http/Controllers/VersionRouteTest.php index e7a72f5..6b60963 100644 --- a/tests/Feature/Http/Controllers/VersionRouteTest.php +++ b/tests/Feature/Http/Controllers/VersionRouteTest.php @@ -17,6 +17,7 @@ class VersionRouteTest extends TestCase use Resource\CreateTrait; use Resource\EditTrait; use Resource\DestroyTrait; + use Resource\LockTrait; public string $fqdn = \GammaMatrix\Playground\Matrix\Models\Version::class; @@ -118,7 +119,7 @@ class VersionRouteTest extends TestCase 'avatar', 'ui', 'assets', - 'version', + 'backlog', 'board', 'flow', 'meta', @@ -130,23 +131,9 @@ class VersionRouteTest extends TestCase 'id', 'session_user_id', 'timestamp', + 'rules', 'validated', - 'info' => [ - 'model_attribute', - 'model_label', - 'model_label_plural', - 'model_route', - 'model_slug_plural', - 'module_label', - 'module_label_plural', - 'module_route', - 'privilege', - 'table', - 'view', - ], - 'input', ], - '_method', ]; protected $structure_index = [