Skip to content

Commit

Permalink
Lock Livewire version down
Browse files Browse the repository at this point in the history
danharrin committed Nov 27, 2024
1 parent 3f170b1 commit f76abb7
Showing 5 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/theme.css

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions docs/03-resources/05-viewing-records.md
Original file line number Diff line number Diff line change
@@ -102,6 +102,29 @@ protected function mutateFormDataBeforeFill(array $data): array

Alternatively, if you're viewing records in a modal action, check out the [Actions documentation](../../actions/prebuilt-actions/view#customizing-data-before-filling-the-form).

## Lifecycle hooks

Hooks may be used to execute code at various points within a page's lifecycle, like before a form is filled. To set up a hook, create a protected method on the View page class with the name of the hook:

```php
use Filament\Resources\Pages\ViewRecord;

class ViewUser extends ViewRecord
{
// ...

protected function beforeFill(): void
{
// Runs before the disabled form fields are populated from the database. Not run on pages using an infolist.
}

protected function afterFill(): void
{
// Runs after the disabled form fields are populated from the database. Not run on pages using an infolist.
}
}
```

## Authorization

For authorization, Filament will observe any [model policies](https://laravel.com/docs/authorization#creating-policies) that are registered in your app.
8 changes: 8 additions & 0 deletions resources/lang/ms/layout.php
Original file line number Diff line number Diff line change
@@ -52,4 +52,12 @@

],

'avatar' => [
'alt' => 'Avatar untuk :name',
],

'logo' => [
'alt' => ':name logo',
],

];
7 changes: 7 additions & 0 deletions resources/lang/ms/unsaved-changes-alert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [

'body' => 'Anda mempunyai perubahan yang belum disimpan. Adakah anda pasti mahu meninggalkan halaman ini?',

];
2 changes: 1 addition & 1 deletion src/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ protected function authenticate($request, array $guards): void
if (! $guard->check()) {
$this->unauthenticated($request, $guards);

return;
return; /** @phpstan-ignore-line */
}

$this->auth->shouldUse(Filament::getAuthGuard());

0 comments on commit f76abb7

Please sign in to comment.