Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed May 22, 2024
1 parent 3d6b6f4 commit 320ea59
Show file tree
Hide file tree
Showing 32 changed files with 669 additions and 97 deletions.
7 changes: 6 additions & 1 deletion routes/matrix.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php
/**
* Playground
*/

declare(strict_types=1);

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| CMS API Routes
| Matrix Routes
|--------------------------------------------------------------------------
|
|
Expand All @@ -17,8 +20,10 @@
'middleware' => config('playground-matrix-resource.middleware.default'),
'namespace' => '\Playground\Matrix\Resource\Http\Controllers',
], function () {

Route::get('/', [
'as' => 'playground.matrix.resource',
'uses' => 'IndexController@index',
])->can('view', Playground\Matrix\Models\Ticket::class);

});
24 changes: 18 additions & 6 deletions src/Http/Controllers/BacklogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public function lock(
];

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -315,7 +317,9 @@ public function restore(
$backlog->restore();

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -353,7 +357,9 @@ public function show(
];

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$meta['input'] = $request->input();
Expand Down Expand Up @@ -389,7 +395,9 @@ public function store(
$backlog->save();

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -427,7 +435,9 @@ public function unlock(
$backlog->save();

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -463,7 +473,9 @@ public function update(
}

if ($request->expectsJson()) {
return (new Resources\Backlog($backlog))->response($request);
return (new Resources\Backlog($backlog))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down
24 changes: 18 additions & 6 deletions src/Http/Controllers/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public function lock(
];

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -315,7 +317,9 @@ public function restore(
$board->restore();

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -353,7 +357,9 @@ public function show(
];

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$meta['input'] = $request->input();
Expand Down Expand Up @@ -389,7 +395,9 @@ public function store(
$board->save();

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -427,7 +435,9 @@ public function unlock(
$board->save();

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -463,7 +473,9 @@ public function update(
}

if ($request->expectsJson()) {
return (new Resources\Board($board))->response($request);
return (new Resources\Board($board))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down
24 changes: 18 additions & 6 deletions src/Http/Controllers/EpicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public function lock(
];

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -315,7 +317,9 @@ public function restore(
$epic->restore();

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -353,7 +357,9 @@ public function show(
];

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$meta['input'] = $request->input();
Expand Down Expand Up @@ -389,7 +395,9 @@ public function store(
$epic->save();

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -427,7 +435,9 @@ public function unlock(
$epic->save();

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -463,7 +473,9 @@ public function update(
}

if ($request->expectsJson()) {
return (new Resources\Epic($epic))->response($request);
return (new Resources\Epic($epic))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down
24 changes: 18 additions & 6 deletions src/Http/Controllers/FlowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public function lock(
];

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -315,7 +317,9 @@ public function restore(
$flow->restore();

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -353,7 +357,9 @@ public function show(
];

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$meta['input'] = $request->input();
Expand Down Expand Up @@ -389,7 +395,9 @@ public function store(
$flow->save();

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -427,7 +435,9 @@ public function unlock(
$flow->save();

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -463,7 +473,9 @@ public function update(
}

if ($request->expectsJson()) {
return (new Resources\Flow($flow))->response($request);
return (new Resources\Flow($flow))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down
24 changes: 18 additions & 6 deletions src/Http/Controllers/MatrixController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public function lock(
];

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -315,7 +317,9 @@ public function restore(
$matrix->restore();

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -353,7 +357,9 @@ public function show(
];

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$meta['input'] = $request->input();
Expand Down Expand Up @@ -389,7 +395,9 @@ public function store(
$matrix->save();

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -427,7 +435,9 @@ public function unlock(
$matrix->save();

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down Expand Up @@ -463,7 +473,9 @@ public function update(
}

if ($request->expectsJson()) {
return (new Resources\Matrix($matrix))->response($request);
return (new Resources\Matrix($matrix))->additional(['meta' => [
'info' => $this->packageInfo,
]])->response($request);
}

$returnUrl = $validated['_return_url'] ?? '';
Expand Down
Loading

0 comments on commit 320ea59

Please sign in to comment.