Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
railken committed Apr 5, 2024
1 parent cb7dc83 commit 2277d5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/Providers/DataViewServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ public function boot()
parent::boot();

Event::listen(\Railken\EloquentMapper\Events\EloquentMapUpdate::class, function ($event) {
Artisan::call('amethyst:data-view:seed', [
'data' => $event->model,
]);

$data = app('amethyst')->get($event->model);

app('amethyst.data-view')->create($data);

event(new \Amethyst\Events\DataViewDataGenerated($event->model));
event(new \Amethyst\Events\DataViewOperationCompleted());

\Spatie\ResponseCache\Facades\ResponseCache::clear();

Check failure on line 45 in src/Providers/DataViewServiceProvider.php

View workflow job for this annotation

GitHub Actions / quality

Call to static method clear() on an unknown class Spatie\ResponseCache\Facades\ResponseCache.

Check failure on line 45 in src/Providers/DataViewServiceProvider.php

View workflow job for this annotation

GitHub Actions / quality

Call to static method clear() on an unknown class Spatie\ResponseCache\Facades\ResponseCache.
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schemas/DataViewSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getAttributes()
->setRequired(true)
->setUnique(true)
->setDefault(function ($i) {
return microtime();
return sha1(rand() * rand());
}),
Attributes\TextAttribute::make('type')
->setRequired(true),
Expand Down

0 comments on commit 2277d5d

Please sign in to comment.