Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 15, 2024
1 parent de9ace3 commit a44511d
Show file tree
Hide file tree
Showing 50 changed files with 74 additions and 82 deletions.
3 changes: 1 addition & 2 deletions config/playground-matrix-resource.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

return [
'layout' => env('PLAYGROUND_MATRIX_RESOURCE_LAYOUT', 'playground::layouts.resource.layout'),
'middleware' => [
'default' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_DEFAULT', 'web'),
'auth' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_AUTH', ['web', 'auth']),
Expand Down Expand Up @@ -53,5 +52,5 @@
'user' => (bool) env('PLAYGROUND_MATRIX_RESOURCE_SITEMAP_USER', true),
'view' => env('PLAYGROUND_MATRIX_RESOURCE_SITEMAP_VIEW', 'playground-matrix-resource::sitemap'),
],
'view' => env('PLAYGROUND_MATRIX_RESOURCE_VIEW', 'playground-matrix-resource::'),
'blade' => env('PLAYGROUND_MATRIX_RESOURCE_BLADE', 'playground-matrix-resource::'),
];
6 changes: 3 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<!-- <testsuite name="Feature">
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite> -->
</testsuite>
</testsuites>
<coverage
includeUncoveredFiles="true"
Expand Down Expand Up @@ -58,7 +58,7 @@
</include>
</source>
<php>
<env name="APP_DEBUG" value="false" />
<env name="APP_DEBUG" value="true" />
<env name="APP_ENV" value="testing" />
<env name="APP_KEY" value="base64:lNTGdmOOxP5uNUVuCj9FB//Ssn8JmRXBdtPEE4/QReE=" />
<env name="AUTH_PROVIDERS_USERS_MODEL" value="Playground\Test\Models\User" />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backlog/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/backlog/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::backlog/form-info',
'withFormStatus' => 'playground-matrix-resource::backlog/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/backlog/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/board/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/board/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::board/form-info',
'withFormStatus' => 'playground-matrix-resource::board/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/board/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/epic/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/epic/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::epic/form-info',
'withFormStatus' => 'playground-matrix-resource::epic/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/epic/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/flow/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/flow/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::flow/form-info',
'withFormStatus' => 'playground-matrix-resource::flow/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/flow/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/milestone/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/milestone/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::milestone/form-info',
'withFormStatus' => 'playground-matrix-resource::milestone/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/milestone/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/note/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/note/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::note/form-info',
'withFormStatus' => 'playground-matrix-resource::note/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/note/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/project/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/project/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::project/form-info',
'withFormStatus' => 'playground-matrix-resource::project/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/project/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/release/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/release/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::release/form-info',
'withFormStatus' => 'playground-matrix-resource::release/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/release/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/roadmap/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/roadmap/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::roadmap/form-info',
'withFormStatus' => 'playground-matrix-resource::roadmap/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/roadmap/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/source/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/source/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::source/form-info',
'withFormStatus' => 'playground-matrix-resource::source/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/source/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/sprint/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/sprint/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::sprint/form-info',
'withFormStatus' => 'playground-matrix-resource::sprint/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/sprint/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/tag/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/tag/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::tag/form-info',
'withFormStatus' => 'playground-matrix-resource::tag/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/tag/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/team/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/team/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::team/form-info',
'withFormStatus' => 'playground-matrix-resource::team/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/team/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/ticket/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/ticket/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::ticket/form-info',
'withFormStatus' => 'playground-matrix-resource::ticket/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/ticket/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/version/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.detail'))
@extends('playground::layouts.resource.detail')
2 changes: 1 addition & 1 deletion resources/views/version/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($package_config['layout'], [
@extends('playground::layouts.resource.form', [
'withFormInfo' => 'playground-matrix-resource::version/form-info',
'withFormStatus' => 'playground-matrix-resource::version/form-status',
])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/version/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$filters = [];
$validated = [];
// $paginator = null;
?>@extends(sprintf('%1$s%2$s', $playground_matrix_resource['view'], 'layouts.resource.index'), [
?>
@extends('playground::layouts.resource.index')
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
6 changes: 2 additions & 4 deletions src/Http/Controllers/BacklogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BacklogController extends Controller
/**
* CREATE the Backlog resource in storage.
*
* @route GET /resource/matrix/backlogs/create playground.matrix.resource.backlogs.create
* @route GET /resource/matrix/backl*ogs/create playground.matrix.resource.backlogs.create
*/
public function create(
CreateRequest $request
Expand Down Expand Up @@ -94,9 +94,7 @@ public function create(
session()->flashInput($flash);
}

return view($this->getViewPath('backlog', 'form'), [
'package_config' => $this->package_config,
]);
return view($this->getViewPath('backlog', 'form'), $data);
}

/**
Expand Down
31 changes: 3 additions & 28 deletions src/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
// use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;

/**
Expand All @@ -19,39 +18,15 @@ abstract class Controller extends BaseController
use ValidatesRequests;
// use DispatchesJobs;

/**
* @var array<string, mixed>
*/
protected ?array $package_config = null;

public function __construct()
{
$this->init();
}

protected function init(Request $request = null): void
{
$package_config = config('playground-matrix-resource');
if (is_array($package_config)) {
$this->package_config = $package_config;
}
}

public function getViewPath(
protected function getViewPath(
string $controller = '',
string $view = ''
): string {

$basePath = '';
if (! empty($this->package_config['view'])
&& is_string($this->package_config['view'])
) {
$basePath = $this->package_config['view'];
}
$basePath = config('playground-matrix-resource.blade');

return sprintf(
'%1$s%2$s%3$s%4$s',
$basePath,
empty($basePath) || ! is_string($basePath) ? '' : $basePath,
$controller,
$view ? '/' : '',
$view
Expand Down
Loading

0 comments on commit a44511d

Please sign in to comment.