Skip to content

Commit

Permalink
Update InteractsWithRecord.php
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jan 9, 2024
1 parent 9b2198f commit a31acb6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ trait InteractsWithRecord
#[Locked]
public Model | int | string | null $record;

public function mountCanAuthorizeAccess(): void
{
abort_unless(static::canAccess(['record' => $this->getRecord()]), 403);
}

protected function resolveRecord(int | string $key): Model
{
$record = static::getResource()::resolveRecordRouteBinding($key);
Expand Down

0 comments on commit a31acb6

Please sign in to comment.