Skip to content

Commit

Permalink
v73.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Jul 6, 2024
2 parents b29fbc2 + 78d6b39 commit d7f266e
Show file tree
Hide file tree
Showing 15 changed files with 858 additions and 33 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ composer cloc
```
➜ playground-test git:(develop) ✗ composer cloc
> cloc --exclude-dir=output,vendor .
137 text files.
79 unique files.
59 files ignored.
151 text files.
88 unique files.
64 files ignored.
github.com/AlDanial/cloc v 1.98 T=0.10 s (778.8 files/s, 87486.7 lines/s)
github.com/AlDanial/cloc v 1.98 T=0.11 s (795.4 files/s, 87907.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 70 1556 1754 4816
PHP 79 1703 2037 5209
XML 4 0 15 294
YAML 1 5 0 249
YAML 1 5 0 275
Markdown 3 35 0 88
JSON 1 0 0 63
JSON 1 0 0 65
-------------------------------------------------------------------------------
SUM: 79 1596 1769 5510
SUM: 88 1743 2052 5931
-------------------------------------------------------------------------------
```

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
],
"require": {
"php": "^8.2",
"brianium/paratest": "^7.4",
"fakerphp/faker": "^1.23",
"friendsofphp/php-cs-fixer": "^3.41",
"larastan/larastan": "^2.0",
"laravel/sanctum": "^4.0",
"nunomaduro/collision": "^8.0",
"orchestra/testbench": "9.*",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^11.0",
Expand Down
46 changes: 46 additions & 0 deletions database/factories/DemoFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
namespace Database\Factories\Playground\Test\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Test\Models\Demo;

/**
* \Database\Factories\Playground\Test\Models\DemoFactory
*
* @extends Factory<Demo>
*/
class DemoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var class-string<Demo>
*/
protected $model = Demo::class;

/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$title = $this->faker->sentence(3);

return [
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
'introduction' => $this->faker->sentence(3),
'content' => $this->faker->sentence(3),
'summary' => $this->faker->sentence(3),
];
}
}
46 changes: 46 additions & 0 deletions database/factories/WidgetFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
namespace Database\Factories\Playground\Test\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Test\Models\Widget;

/**
* \Database\Factories\Playground\Test\Models\WidgetFactory
*
* @extends Factory<Widget>
*/
class WidgetFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var class-string<Widget>
*/
protected $model = Widget::class;

/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$title = $this->faker->sentence(3);

return [
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
'introduction' => $this->faker->sentence(3),
'content' => $this->faker->sentence(3),
'summary' => $this->faker->sentence(3),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php
/**
* Playground
*/

declare(strict_types=1);

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

/**
* \Playground\Matrix\Models\Tag
*/
return new class() extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('testing_demo', function (Blueprint $table) {

// Primary key

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

// IDs

$table->uuid('created_by_id')->nullable()->index();
$table->uuid('modified_by_id')->nullable()->index();
$table->uuid('owned_by_id')->nullable()->index();
$table->uuid('parent_id')->nullable()->index();
$table->string('demo_type')->nullable()->index();

// Dates

$table->timestamps();

$table->softDeletes();

// Permissions

$table->bigInteger('gids')->default(0)->unsigned();
$table->tinyInteger('po')->default(0)->unsigned();
$table->tinyInteger('pg')->default(0)->unsigned();
$table->tinyInteger('pw')->default(0)->unsigned();
$table->boolean('only_admin')->default(0);
$table->boolean('only_user')->default(0);
$table->boolean('only_guest')->default(0);
$table->boolean('allow_public')->default(0);

// Status

$table->bigInteger('status')->default(0)->unsigned();
$table->bigInteger('rank')->default(0);
$table->bigInteger('size')->default(0);

// Matrix

$table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->bigInteger('x')->nullable();
$table->bigInteger('y')->nullable();
$table->bigInteger('z')->nullable();
$table->decimal('r', 65, 10)->nullable();
$table->decimal('theta', 10, 6)->nullable();
$table->decimal('rho', 10, 6)->nullable();
$table->decimal('phi', 10, 6)->nullable();
$table->decimal('elevation', 65, 10)->nullable();
$table->decimal('latitude', 8, 6)->nullable();
$table->decimal('longitude', 9, 6)->nullable();

// Flags

$table->boolean('active')->default(1)->index();
$table->boolean('flagged')->default(0);
$table->boolean('internal')->default(0);
$table->boolean('locked')->default(0);
$table->boolean('unknown')->default(0);

// Columns

$table->string('label', 128)->default('');
$table->string('title', 255)->default('');
$table->string('byline', 255)->default('');
$table->string('slug', 128)->nullable()->index();
$table->string('url', 512)->default('');
$table->string('description', 512)->default('');
$table->string('introduction', 512)->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// Ui

$table->string('icon', 128)->default('');
$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');
$table->json('ui')->nullable()->default(new Expression('(JSON_OBJECT())'));

// JSON

$table->json('assets')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('meta')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('notes')->nullable()->default(new Expression('(JSON_ARRAY())'))->comment('Array of note objects');
$table->json('options')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('sources')->nullable()->default(new Expression('(JSON_OBJECT())'));
});
}

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

declare(strict_types=1);

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

/**
* \Playground\Matrix\Models\Tag
*/
return new class() extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('testing_widgets', function (Blueprint $table) {

// Primary key

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

// IDs

$table->uuid('created_by_id')->nullable()->index();
$table->uuid('modified_by_id')->nullable()->index();
$table->uuid('owned_by_id')->nullable()->index();
$table->uuid('parent_id')->nullable()->index();
$table->string('widget_type')->nullable()->index();
$table->uuid('demo_id')->nullable()->index();

// Dates

$table->timestamps();

$table->softDeletes();

// Permissions

$table->bigInteger('gids')->default(0)->unsigned();
$table->tinyInteger('po')->default(0)->unsigned();
$table->tinyInteger('pg')->default(0)->unsigned();
$table->tinyInteger('pw')->default(0)->unsigned();
$table->boolean('only_admin')->default(0);
$table->boolean('only_user')->default(0);
$table->boolean('only_guest')->default(0);
$table->boolean('allow_public')->default(0);

// Status

$table->bigInteger('status')->default(0)->unsigned();
$table->bigInteger('rank')->default(0);
$table->bigInteger('size')->default(0);

// Matrix

$table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->bigInteger('x')->nullable();
$table->bigInteger('y')->nullable();
$table->bigInteger('z')->nullable();
$table->decimal('r', 65, 10)->nullable();
$table->decimal('theta', 10, 6)->nullable();
$table->decimal('rho', 10, 6)->nullable();
$table->decimal('phi', 10, 6)->nullable();
$table->decimal('elevation', 65, 10)->nullable();
$table->decimal('latitude', 8, 6)->nullable();
$table->decimal('longitude', 9, 6)->nullable();

// Flags

$table->boolean('active')->default(1)->index();
$table->boolean('flagged')->default(0);
$table->boolean('internal')->default(0);
$table->boolean('locked')->default(0);
$table->boolean('unknown')->default(0);

// Columns

$table->string('label', 128)->default('');
$table->string('title', 255)->default('');
$table->string('byline', 255)->default('');
$table->string('slug', 128)->nullable()->index();
$table->string('url', 512)->default('');
$table->string('description', 512)->default('');
$table->string('introduction', 512)->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// Ui

$table->string('icon', 128)->default('');
$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');
$table->json('ui')->nullable()->default(new Expression('(JSON_OBJECT())'));

// JSON

$table->json('assets')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('meta')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('notes')->nullable()->default(new Expression('(JSON_ARRAY())'))->comment('Array of note objects');
$table->json('options')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('sources')->nullable()->default(new Expression('(JSON_OBJECT())'));
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('testing_widgets');
}
};
Loading

0 comments on commit d7f266e

Please sign in to comment.