Skip to content

Commit 5b982d6

Browse files
authored
Merge pull request #651 from wayofdev/feat/laravel-telescope
2 parents 4740b74 + 6fe30e5 commit 5b982d6

File tree

5 files changed

+82
-3
lines changed

5 files changed

+82
-3
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace WayOfDev\Cycle\Bridge\Telescope\Entities;
6+
7+
use Cycle\Annotated\Annotation\Column;
8+
use Cycle\Annotated\Annotation\Entity;
9+
use Cycle\Annotated\Annotation\Table\Index;
10+
use DateTimeImmutable;
11+
12+
#[Index(columns: ['batch_id'])]
13+
#[Index(columns: ['family_hash'])]
14+
#[Index(columns: ['created_at'])]
15+
#[Index(columns: ['type', 'should_display_on_index'])]
16+
#[Entity(table: 'telescope_entries')]
17+
class TelescopeEntry
18+
{
19+
#[Column(type: 'bigInteger', primary: true)]
20+
public int $sequence;
21+
22+
#[Column(type: 'uuid', unique: true)]
23+
public string $uuid;
24+
25+
#[Column(type: 'uuid')]
26+
public string $batchId;
27+
28+
#[Column(type: 'string', nullable: true)]
29+
public string $familyHash;
30+
31+
#[Column(type: 'boolean', default: true)]
32+
public bool $shouldDisplayOnIndex;
33+
34+
#[Column(type: 'string', size: 20)]
35+
public string $type;
36+
37+
#[Column(type: 'longText')]
38+
public string $content;
39+
40+
#[Column(type: 'datetime', nullable: true)]
41+
public ?DateTimeImmutable $createdAt;
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace WayOfDev\Cycle\Bridge\Telescope\Entities;
6+
7+
use Cycle\Annotated\Annotation\Column;
8+
use Cycle\Annotated\Annotation\Entity;
9+
use Cycle\Annotated\Annotation\ForeignKey;
10+
use Cycle\Annotated\Annotation\Table\Index;
11+
12+
#[Index(columns: ['entry_uuid', 'tag'])]
13+
#[Index(columns: ['tag'])]
14+
#[ForeignKey(target: TelescopeEntry::class, innerKey: 'entry_uuid', outerKey: 'uuid', action: 'CASCADE')]
15+
#[Entity(table: 'telescope_entry_tags')]
16+
class TelescopeEntryTags
17+
{
18+
#[Column(type: 'uuid', primary: true)]
19+
public string $entryUuid;
20+
21+
#[Column(type: 'string')]
22+
public string $tag;
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace WayOfDev\Cycle\Bridge\Telescope\Entities;
6+
7+
use Cycle\Annotated\Annotation\Column;
8+
use Cycle\Annotated\Annotation\Entity;
9+
10+
#[Entity(table: 'telescope_monitoring')]
11+
class TelescopeMonitoring
12+
{
13+
#[Column(type: 'string', primary: true)]
14+
public string $tag;
15+
}

tests/database/migrations/cycle/.gitignore

Whitespace-only changes.

tests/src/TestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Illuminate\Contracts\Console\Kernel;
1010
use Illuminate\Support\Facades\Artisan;
1111
use Orchestra\Testbench\TestCase as OrchestraTestCase;
12-
use Spatie\LaravelRay\RayServiceProvider;
1312
use WayOfDev\Cycle\Bridge\Laravel\Providers\CycleServiceProvider;
1413
use WayOfDev\Cycle\Testing\Concerns\InteractsWithDatabase;
1514
use WayOfDev\Cycle\Testing\RefreshDatabase;
@@ -53,7 +52,8 @@ protected function setUp(): void
5352
config()->set([
5453
'cycle.tokenizer.directories' => array_merge(
5554
config('cycle.tokenizer.directories'),
56-
[__DIR__ . '/../app/Entities']
55+
[__DIR__ . '/../app/Entities'],
56+
// [__DIR__ . '/../../src/Bridge/Telescope/Entities'],
5757
),
5858
'cycle.migrations.directory' => $this->migrationsPath,
5959
]);
@@ -99,7 +99,6 @@ protected function getPackageProviders($app): array
9999
{
100100
return [
101101
CycleServiceProvider::class,
102-
RayServiceProvider::class,
103102
];
104103
}
105104
}

0 commit comments

Comments
 (0)