Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 19, 2024
1 parent 8b0431f commit a1ae005
Show file tree
Hide file tree
Showing 72 changed files with 945 additions and 267 deletions.
105 changes: 103 additions & 2 deletions config/playground-matrix-resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

return [
'middleware' => [
'default' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_DEFAULT', 'web'),
'default' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_DEFAULT', ['web']),
'auth' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_AUTH', ['web', 'auth']),
'guest' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_GUEST', 'web'),
'guest' => env('PLAYGROUND_MATRIX_RESOURCE_MIDDLEWARE_GUEST', ['web']),
],
'policies' => [
Playground\Matrix\Models\Backlog::class => Playground\Matrix\Resource\Policies\BacklogPolicy::class,
Expand Down Expand Up @@ -53,4 +53,105 @@
'view' => env('PLAYGROUND_MATRIX_RESOURCE_SITEMAP_VIEW', 'playground-matrix-resource::sitemap'),
],
'blade' => env('PLAYGROUND_MATRIX_RESOURCE_BLADE', 'playground-matrix-resource::'),

'abilities' => [
'admin' => [
'playground-matrix-resource:*',
],
'manager' => [
'playground-matrix-resource:backlog:*',
'playground-matrix-resource:board:*',
'playground-matrix-resource:epic:*',
'playground-matrix-resource:flow:*',
'playground-matrix-resource:milestone:*',
'playground-matrix-resource:note:*',
'playground-matrix-resource:project:*',
'playground-matrix-resource:release:*',
'playground-matrix-resource:roadmap:*',
'playground-matrix-resource:source:*',
'playground-matrix-resource:sprint:*',
'playground-matrix-resource:tag:*',
'playground-matrix-resource:team:*',
'playground-matrix-resource:ticket:*',
'playground-matrix-resource:version:*',
],
'user' => [
'playground-matrix-resource:backlog:view',
'playground-matrix-resource:backlog:viewAny',
'playground-matrix-resource:board:view',
'playground-matrix-resource:board:viewAny',
'playground-matrix-resource:epic:view',
'playground-matrix-resource:epic:viewAny',
'playground-matrix-resource:flow:view',
'playground-matrix-resource:flow:viewAny',
'playground-matrix-resource:milestone:view',
'playground-matrix-resource:milestone:viewAny',
'playground-matrix-resource:note:view',
'playground-matrix-resource:note:viewAny',
'playground-matrix-resource:project:view',
'playground-matrix-resource:project:viewAny',
'playground-matrix-resource:release:view',
'playground-matrix-resource:release:viewAny',
'playground-matrix-resource:roadmap:view',
'playground-matrix-resource:roadmap:viewAny',
'playground-matrix-resource:source:view',
'playground-matrix-resource:source:viewAny',
'playground-matrix-resource:sprint:view',
'playground-matrix-resource:sprint:viewAny',
'playground-matrix-resource:tag:view',
'playground-matrix-resource:tag:viewAny',
'playground-matrix-resource:team:view',
'playground-matrix-resource:team:viewAny',
'playground-matrix-resource:ticket:view',
'playground-matrix-resource:ticket:viewAny',
'playground-matrix-resource:ticket:create',
'playground-matrix-resource:ticket:edit',
'playground-matrix-resource:ticket:store',
'playground-matrix-resource:ticket:update',
'playground-matrix-resource:version:view',
'playground-matrix-resource:version:viewAny',
],
// 'guest' => [
// 'deny',
// ],
// 'guest' => [
// 'app:view',

// 'playground:view',

// 'playground-auth:logout',
// 'playground-auth:reset-password',

// 'playground-matrix-resource:backlog:view',
// 'playground-matrix-resource:backlog:viewAny',
// 'playground-matrix-resource:board:view',
// 'playground-matrix-resource:board:viewAny',
// 'playground-matrix-resource:epic:view',
// 'playground-matrix-resource:epic:viewAny',
// 'playground-matrix-resource:flow:view',
// 'playground-matrix-resource:flow:viewAny',
// 'playground-matrix-resource:milestone:view',
// 'playground-matrix-resource:milestone:viewAny',
// 'playground-matrix-resource:note:view',
// 'playground-matrix-resource:note:viewAny',
// 'playground-matrix-resource:project:view',
// 'playground-matrix-resource:project:viewAny',
// 'playground-matrix-resource:release:view',
// 'playground-matrix-resource:release:viewAny',
// 'playground-matrix-resource:roadmap:view',
// 'playground-matrix-resource:roadmap:viewAny',
// 'playground-matrix-resource:source:view',
// 'playground-matrix-resource:source:viewAny',
// 'playground-matrix-resource:sprint:view',
// 'playground-matrix-resource:sprint:viewAny',
// 'playground-matrix-resource:tag:view',
// 'playground-matrix-resource:tag:viewAny',
// 'playground-matrix-resource:team:view',
// 'playground-matrix-resource:team:viewAny',
// 'playground-matrix-resource:ticket:view',
// 'playground-matrix-resource:ticket:viewAny',
// 'playground-matrix-resource:version:view',
// 'playground-matrix-resource:version:viewAny',
// ],
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {

// IDs
$table->uuid('id')->primary();

$table->uuid('created_id')->nullable()->index();
$table->uuid('modified_id')->nullable()->index();

// Date columns

$table->timestamps();
$table->timestamp('email_verified_at')->nullable();

// Status

$table->softDeletes();

$table->tinyInteger('active')->unsigned()->index()->default(0);
$table->tinyInteger('banned')->unsigned()->index()->default(0);
$table->tinyInteger('closed')->unsigned()->index()->default(0);
$table->tinyInteger('flagged')->unsigned()->index()->default(0);
$table->tinyInteger('internal')->unsigned()->index()->default(0);
$table->tinyInteger('locked')->unsigned()->index()->default(0);

// UI

$table->string('style', 128)->default('');
$table->string('klass', 128)->default('');
$table->string('icon', 128)->default('');

// Entity columns

$table->string('name')->default('');
$table->string('email')->unique();
$table->string('password')->default('');
$table->string('phone')->default('');
$table->string('locale')->default('');
$table->string('timezone')->default('');

$table->rememberToken();

$table->string('role')->default('');

// A link to the external source of the user.
$table->string('url', 512)->default('');

// Description is an internal field.
$table->string('description', 512)->default('');

$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');

// The introduction should be the first 255 characters or less of the content.
// The introduction is visible to the client. No HTML.
$table->string('introduction', 512)->default('');

// The HTML content of the user.
$table->mediumText('content')->nullable();

// The summary of the content, HTML allowed, to be shown to the client.
$table->mediumText('summary')->nullable();

$table->json('abilities')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of ability strings');
$table->json('accounts')
->default(new Expression('(JSON_OBJECT())'))
->comment('User accounts object');
$table->json('address')
->default(new Expression('(JSON_OBJECT())'))
->comment('User address object');
$table->json('contact')
->default(new Expression('(JSON_OBJECT())'))
->comment('User contact object');
$table->json('meta')
->default(new Expression('(JSON_OBJECT())'))
->comment('Model meta object');
$table->json('notes')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of note objects');
$table->json('options')
->default(new Expression('(JSON_OBJECT())'))
->comment('Model options object');
$table->json('registration')
->default(new Expression('(JSON_OBJECT())'))
->comment('Registration information object');
$table->json('roles')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of role strings');
$table->json('permissions')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of permission strings');
$table->json('privileges')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of privilege strings');

});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('password_reset_tokens');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->uuidMorphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
2 changes: 1 addition & 1 deletion resources/views/backlog/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/board/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/epic/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/flow/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends($playground_matrix_resource['layout'])
@extends('playground::layouts.resource.layout')

@section('title', 'Matrix')

Expand Down
2 changes: 1 addition & 1 deletion resources/views/milestone/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/note/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/project/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/release/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/roadmap/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/source/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$validated = [];
// $paginator = null;
?>
@extends('playground::layouts.resource.index')
@extends('playground::layouts.resource.index', [
// 'withTableColumns' => [
// 'label' => [
// 'linkType' => 'id',
Expand Down
Loading

0 comments on commit a1ae005

Please sign in to comment.