F
Filamentβ€’16mo ago
Matthew

Cant find view for Filament-Peek

According to the docs, I have to point the function to the blade file of the resource, but it doesnt exist. How can I publish it? Or am I missing something else?
<?php

namespace App\Filament\Resources\TestUploadResource\Pages;

use App\Filament\Resources\TestUploadResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Pboivin\FilamentPeek\Pages\Actions\PreviewAction;
use Pboivin\FilamentPeek\Pages\Concerns\HasPreviewModal;

class EditTestUpload extends EditRecord
{
use HasPreviewModal;
protected static string $resource = TestUploadResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
PreviewAction::make(),

];
}

protected function getActions(): array
{
return [
PreviewAction::make(),
];
}

protected function getPreviewModalView(): ?string
{
return 'test_uploads.preview';
}

protected function getPreviewModalDataRecordKey(): ?string
{
return 'test_uploads';
}
}
<?php

namespace App\Filament\Resources\TestUploadResource\Pages;

use App\Filament\Resources\TestUploadResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Pboivin\FilamentPeek\Pages\Actions\PreviewAction;
use Pboivin\FilamentPeek\Pages\Concerns\HasPreviewModal;

class EditTestUpload extends EditRecord
{
use HasPreviewModal;
protected static string $resource = TestUploadResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
PreviewAction::make(),

];
}

protected function getActions(): array
{
return [
PreviewAction::make(),
];
}

protected function getPreviewModalView(): ?string
{
return 'test_uploads.preview';
}

protected function getPreviewModalDataRecordKey(): ?string
{
return 'test_uploads';
}
}
Docs: https://github.com/pboivin/filament-peek/blob/2.x/docs/page-previews.md
GitHub
filament-peek/docs/page-previews.md at 2.x Β· pboivin/filament-peek
Full-screen page preview modal for Filament. Contribute to pboivin/filament-peek development by creating an account on GitHub.
No description
7 Replies
Matthew
MatthewOPβ€’16mo ago
No description
Matthew
MatthewOPβ€’16mo ago
Ive added the files manually and I still got some issues:
<x-layout>
@isset($isPeekPreviewModal)
<x-preview-banner />
@endisset

<x-container>
...
</x-container>
</x-layout>
<x-layout>
@isset($isPeekPreviewModal)
<x-preview-banner />
@endisset

<x-container>
...
</x-container>
</x-layout>
Matthew
MatthewOPβ€’16mo ago
No description
Matthew
MatthewOPβ€’16mo ago
No description
Patrick Boivin
Patrick Boivinβ€’16mo ago
Hi @thethunderturner, you can ask plugin specific question in the #peek channel But to your issue, the preview.blade.php is just a regular view from your project, you don't need to publish anything So test_uploads.preview should correspond to resources/views/test_uploads/preview.blade.php <x-preview-banner /> is just an example to illustrate the use of $isPeekPreviewModal. It says you can check the existence of this variable to determine if the Blade view is used in the context of a preview or not.
Matthew
MatthewOPβ€’16mo ago
Okk thank you I dont mean to offend but I find it a bit complicated πŸ˜…
Patrick Boivin
Patrick Boivinβ€’16mo ago
I'm open to suggestions, don't hesitate to point out exactly what was difficult to understand in the documentation. I've been getting very little feedback on that so far.
Want results from more Discord servers?
Add your server