Skip to content

Commit bde9501

Browse files
committed
wip
1 parent 2a71f78 commit bde9501

File tree

7 files changed

+18
-22
lines changed

7 files changed

+18
-22
lines changed

database/factories/InboundWebhookFactory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Basement\Webhooks\Database\Factories;
44

5-
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Illuminate\Support\Carbon;
75
use Basement\Webhooks\Enums\InboundWebhookSource;
86
use Basement\Webhooks\Models\InboundWebhook;
7+
use Illuminate\Database\Eloquent\Factories\Factory;
8+
use Illuminate\Support\Carbon;
99

1010
class InboundWebhookFactory extends Factory
1111
{
@@ -17,7 +17,7 @@ public function definition(): array
1717
'source' => $this->faker->randomElement(InboundWebhookSource::cases()),
1818
'event' => $this->faker->randomElement([
1919
'signature.accepted', 'signature.rejected', 'signature.viewed', 'signature.signed',
20-
'mail.sent', 'mail.opened', 'mail.refused', 'mail.delivered', 'mail.reason'
20+
'mail.sent', 'mail.opened', 'mail.refused', 'mail.delivered', 'mail.reason',
2121
]),
2222
'url' => $this->faker->url(),
2323
'payload' => $this->generateJsonElement(),
@@ -48,14 +48,14 @@ private function generateJsonElement(): string
4848
'phone' => null,
4949
'cpf' => '35061134885',
5050
'cnpj' => null,
51-
'birthday' => '1999-03-08'
51+
'birthday' => '1999-03-08',
5252
],
5353
'document' => '123',
5454

5555
],
5656
'previous_attributes' => [],
57-
'created_at' => '2025-07-15T18:37:28.098812Z'
58-
]
57+
'created_at' => '2025-07-15T18:37:28.098812Z',
58+
],
5959
]);
6060
}
6161
}

src/Filament/Admin/Resources/InboundWebhook/InboundWebhookResource.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace Basement\Webhooks\Filament\Admin\Resources\InboundWebhook;
44

55
use BackedEnum;
6+
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages\ListInboundWebhooks;
7+
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages\ViewInboundWebhook;
8+
use Basement\Webhooks\Models\InboundWebhook;
69
use Filament\Resources\Resource;
710
use Filament\Support\Icons\Heroicon;
811
use Illuminate\Database\Eloquent\Builder;
912
use Illuminate\Database\Eloquent\SoftDeletingScope;
10-
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages\ListInboundWebhooks;
11-
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages\ViewInboundWebhook;
12-
use Basement\Webhooks\Models\InboundWebhook;
1313

1414
class InboundWebhookResource extends Resource
1515
{

src/Filament/Admin/Resources/InboundWebhook/Pages/ListInboundWebhooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages;
44

5+
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\InboundWebhookResource;
56
use Filament\Actions\BulkActionGroup;
67
use Filament\Actions\DeleteAction;
78
use Filament\Actions\DeleteBulkAction;
@@ -12,7 +13,6 @@
1213
use Filament\Tables\Columns\TextColumn;
1314
use Filament\Tables\Filters\TrashedFilter;
1415
use Filament\Tables\Table;
15-
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\InboundWebhookResource;
1616

1717
class ListInboundWebhooks extends ListRecords
1818
{

src/Filament/Admin/Resources/InboundWebhook/Pages/ViewInboundWebhook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\Pages;
44

5+
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\InboundWebhookResource;
56
use Filament\Infolists\Components\CodeEntry;
67
use Filament\Infolists\Components\TextEntry;
78
use Filament\Resources\Pages\ViewRecord;
89
use Filament\Schemas\Components\Grid;
910
use Filament\Schemas\Schema;
1011
use Phiki\Grammar\Grammar;
11-
use Basement\Webhooks\Filament\Admin\Resources\InboundWebhook\InboundWebhookResource;
1212

1313
class ViewInboundWebhook extends ViewRecord
1414
{
@@ -33,7 +33,7 @@ public function infolist(Schema $schema): Schema
3333
CodeEntry::make('payload')
3434
->state(fn ($record) => json_encode(json_decode((string) $record->payload), JSON_PRETTY_PRINT))
3535
->grammar(Grammar::Json)
36-
->columnSpanFull()
36+
->columnSpanFull(),
3737
]);
3838
}
3939
}

src/FilamentWebhookPlugin.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
class FilamentWebhookPlugin implements Plugin
1010
{
11-
1211
public function getId(): string
1312
{
1413
return 'filament-webhooks';
@@ -17,11 +16,9 @@ public function getId(): string
1716
public function register(Panel $panel): void
1817
{
1918
$panel->resources([
20-
InboundWebhookResource::class
19+
InboundWebhookResource::class,
2120
]);
2221
}
2322

24-
public function boot(Panel $panel): void
25-
{
26-
}
27-
}
23+
public function boot(Panel $panel): void {}
24+
}

src/Models/InboundWebhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Basement\Webhooks\Models;
44

5+
use Basement\Webhooks\Enums\InboundWebhookSource;
56
use Illuminate\Database\Eloquent\Concerns\HasUuids;
67
use Illuminate\Database\Eloquent\Factories\HasFactory;
78
use Illuminate\Database\Eloquent\Model;
89
use Illuminate\Database\Eloquent\SoftDeletes;
9-
use Basement\Webhooks\Enums\InboundWebhookSource;
1010

1111
class InboundWebhook extends Model
1212
{

tests/TestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected function setUp(): void
1313
parent::setUp();
1414

1515
Factory::guessFactoryNamesUsing(
16-
fn(string $modelName) => 'Basement\\Webhooks\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
16+
fn (string $modelName) => 'Basement\\Webhooks\\Database\\Factories\\'.class_basename($modelName).'Factory'
1717
);
1818
}
1919

@@ -28,8 +28,7 @@ public function getEnvironmentSetUp($app)
2828
{
2929
config()->set('database.default', 'testing');
3030

31-
32-
foreach (\Illuminate\Support\Facades\File::allFiles(__DIR__ . '/../database/migrations') as $migration) {
31+
foreach (\Illuminate\Support\Facades\File::allFiles(__DIR__.'/../database/migrations') as $migration) {
3332
(include $migration->getRealPath())->up();
3433
}
3534

0 commit comments

Comments
 (0)