Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/Bridge/Telescope/Entities/TelescopeEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

namespace WayOfDev\Cycle\Bridge\Telescope\Entities;

use Cycle\Annotated\Annotation\Column;
use Cycle\Annotated\Annotation\Entity;
use Cycle\Annotated\Annotation\Table\Index;
use DateTimeImmutable;

#[Index(columns: ['batch_id'])]
#[Index(columns: ['family_hash'])]
#[Index(columns: ['created_at'])]
#[Index(columns: ['type', 'should_display_on_index'])]
#[Entity(table: 'telescope_entries')]
class TelescopeEntry
{
#[Column(type: 'bigInteger', primary: true)]
public int $sequence;

#[Column(type: 'uuid', unique: true)]
public string $uuid;

#[Column(type: 'uuid')]
public string $batchId;

#[Column(type: 'string', nullable: true)]
public string $familyHash;

#[Column(type: 'boolean', default: true)]
public bool $shouldDisplayOnIndex;

#[Column(type: 'string', size: 20)]
public string $type;

#[Column(type: 'longText')]
public string $content;

#[Column(type: 'datetime', nullable: true)]
public ?DateTimeImmutable $createdAt;
}
23 changes: 23 additions & 0 deletions src/Bridge/Telescope/Entities/TelescopeEntryTags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace WayOfDev\Cycle\Bridge\Telescope\Entities;

use Cycle\Annotated\Annotation\Column;
use Cycle\Annotated\Annotation\Entity;
use Cycle\Annotated\Annotation\ForeignKey;
use Cycle\Annotated\Annotation\Table\Index;

#[Index(columns: ['entry_uuid', 'tag'])]
#[Index(columns: ['tag'])]
#[ForeignKey(target: TelescopeEntry::class, innerKey: 'entry_uuid', outerKey: 'uuid', action: 'CASCADE')]
#[Entity(table: 'telescope_entry_tags')]
class TelescopeEntryTags
{
#[Column(type: 'uuid', primary: true)]
public string $entryUuid;

#[Column(type: 'string')]
public string $tag;
}
15 changes: 15 additions & 0 deletions src/Bridge/Telescope/Entities/TelescopeMonitoring.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace WayOfDev\Cycle\Bridge\Telescope\Entities;

use Cycle\Annotated\Annotation\Column;
use Cycle\Annotated\Annotation\Entity;

#[Entity(table: 'telescope_monitoring')]
class TelescopeMonitoring
{
#[Column(type: 'string', primary: true)]
public string $tag;
}
Empty file.
5 changes: 2 additions & 3 deletions tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Support\Facades\Artisan;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Spatie\LaravelRay\RayServiceProvider;
use WayOfDev\Cycle\Bridge\Laravel\Providers\CycleServiceProvider;
use WayOfDev\Cycle\Testing\Concerns\InteractsWithDatabase;
use WayOfDev\Cycle\Testing\RefreshDatabase;
Expand Down Expand Up @@ -53,7 +52,8 @@ protected function setUp(): void
config()->set([
'cycle.tokenizer.directories' => array_merge(
config('cycle.tokenizer.directories'),
[__DIR__ . '/../app/Entities']
[__DIR__ . '/../app/Entities'],
// [__DIR__ . '/../../src/Bridge/Telescope/Entities'],
),
'cycle.migrations.directory' => $this->migrationsPath,
]);
Expand Down Expand Up @@ -99,7 +99,6 @@ protected function getPackageProviders($app): array
{
return [
CycleServiceProvider::class,
RayServiceProvider::class,
];
}
}