Povilas K
Povilas K
FFilament
Created by frame on 1/14/2025 in #❓┊help
FileUpload file validation after upload, before submit
Our article about it: https://laraveldaily.com/post/filament-validate-one-form-field-live-before-submit from 2023 so double check if still works
5 replies
FFilament
Created by jjo63 on 12/14/2024 in #❓┊help
Building own "resource" to run within the Filament UI
Well, I used AI only to provide a quick answer with the IDEA on how you should go, not for literal copy-pasting the answer, so of course, you need to double-check, and that's why AI generators and assistants won't replace devs anytime soon, because in 99% cases some modifications are needed anyway, so devs need to understand how it works. But something for me to think about for the future: probably on this Discord and forums it's dangerous/harmful to just give the answer from AI, as most people seem to be not experienced enough to process it. That said, maybe sometimes it's better to provide this answer than no answer at all, as reproducing the situation for me and providing the working code would take an hour or two (which I don't have as free time).
10 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
@CodeWithDennis great idea, adding on my to-do list!
28 replies
FFilament
Created by namrata on 12/16/2024 in #❓┊help
Spatie Media Library
great, thanks, will take a look, or ask one of my colleagues to help. The problem may be related specifically to s3 and not spatie media library
24 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Curious what was the problem?
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Mmmm yeah, that may be a good point, in our tutorial we don't use Shield, so maybe that plugin adds extra check for the panel if it doesn't allow you to log in. Sorry, from here I can't help much without debugging your full code and experimenting with it.
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
What do you mean exactly by "courier can't login"? What error happens after login?
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Yeah maybe in your case something else is required... in our testing that's the only thing we did. Maybe you're on some older Laravel version?
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Hard to comment without debugging the full code of your project, sorry
28 replies
FFilament
Created by keops_IV on 12/6/2024 in #❓┊help
Customer business logic into Login in Filament 3
Probably irrelevant for the author at this point but will post it for others to reference in the future, we published it as a free tutorial: https://filamentexamples.com/tutorial/login-extra-validation
7 replies
FFilament
Created by namrata on 12/16/2024 in #❓┊help
Spatie Media Library
@namrata quick update - wanted to play with the scenario but realized it would be too much time for me to even create such a project to reproduce that scenario. You probably don't want to share all the code, so please create a separate (public?) repo where I (or anyone else) would be able to reproduce and then debug the situation.
24 replies
FFilament
Created by namrata on 12/16/2024 in #❓┊help
Spatie Media Library
hmm, I thought you were pre-filling the CREATE form without any more data, so maybe that's different. Anyway I don't have a quick answer, would need to experiment in my free time how to autoload the image, I will get back to you if I have the answer later this week
24 replies
FFilament
Created by namrata on 12/16/2024 in #❓┊help
Spatie Media Library
but edit page doesn't UPLOAD the file for you, it just shows the existing file from the database, so it's not the same, in my opinion. Maybe it's possible but I haven't done it that way, sorry.
24 replies
FFilament
Created by namrata on 12/16/2024 in #❓┊help
Spatie Media Library
I don't think you can "fill" the upload automatically for the user filling the form, at least I haven't done it. What I would do instead is show the IMAGE like img tag visually and place its value as default in a HIDDEN field of HTML, or a value in Livewire component. And if someone uploads some OTHER file instead, then saving would take that new file, otherwise take the URL from default hidden file, and if needed copy that file into your storage which would give a new local URL.
24 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
28 replies
FFilament
Created by jjo63 on 12/14/2024 in #❓┊help
Building own "resource" to run within the Filament UI
<!-- resources/views/filament/pages/custom-search.blade.php -->
<x-filament-panels::page>
<form wire:submit="search">
{{ $this->form }}

<x-filament::button type="submit" class="mt-4">
Search
</x-filament::button>
</form>

@if(count($searchResults) > 0)
<div class="mt-6">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
@foreach($searchResults as $result)
<div class="mb-4 p-4 border rounded">
<!-- Customize this based on your result structure -->
<h3 class="text-lg font-semibold">{{ $result->title ?? '' }}</h3>
<p>{{ $result->description ?? '' }}</p>
</div>
@endforeach
</div>
</div>
</div>
@endif
</x-filament-panels::page>
<!-- resources/views/filament/pages/custom-search.blade.php -->
<x-filament-panels::page>
<form wire:submit="search">
{{ $this->form }}

<x-filament::button type="submit" class="mt-4">
Search
</x-filament::button>
</form>

@if(count($searchResults) > 0)
<div class="mt-6">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
@foreach($searchResults as $result)
<div class="mb-4 p-4 border rounded">
<!-- Customize this based on your result structure -->
<h3 class="text-lg font-semibold">{{ $result->title ?? '' }}</h3>
<p>{{ $result->description ?? '' }}</p>
</div>
@endforeach
</div>
</div>
</div>
@endif
</x-filament-panels::page>
AdminPanelProvider.php:
use App\Filament\Pages\CustomSearch;

// In the panel() method:
return $panel
->pages([
CustomSearch::class,
]);
use App\Filament\Pages\CustomSearch;

// In the panel() method:
return $panel
->pages([
CustomSearch::class,
]);
10 replies
FFilament
Created by jjo63 on 12/14/2024 in #❓┊help
Building own "resource" to run within the Filament UI
// app/Filament/Pages/CustomSearch.php
namespace App\Filament\Pages;

use Filament\Pages\Page;
use Illuminate\Contracts\View\View;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;

class CustomSearch extends Page
{
use InteractsWithForms;

protected static ?string $navigationIcon = 'heroicon-o-magnifying-glass';
protected static ?string $navigationLabel = 'Custom Search';
protected static ?string $title = 'Custom Search';
protected static ?string $slug = 'custom-search';

public ?string $searchQuery = '';
public $searchResults = [];

public function mount(): void
{
$this->form->fill();
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('searchQuery')
->label('Search Term')
->placeholder('Enter your search term')
->required(),
]);
}

public function search(): void
{
$this->validate();

// Here you would implement your Supabase search logic
// Example:
// $this->searchResults = YourSupabaseService::search($this->searchQuery);
}

public function render(): View
{
return view('filament.pages.custom-search');
}
}
// app/Filament/Pages/CustomSearch.php
namespace App\Filament\Pages;

use Filament\Pages\Page;
use Illuminate\Contracts\View\View;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;

class CustomSearch extends Page
{
use InteractsWithForms;

protected static ?string $navigationIcon = 'heroicon-o-magnifying-glass';
protected static ?string $navigationLabel = 'Custom Search';
protected static ?string $title = 'Custom Search';
protected static ?string $slug = 'custom-search';

public ?string $searchQuery = '';
public $searchResults = [];

public function mount(): void
{
$this->form->fill();
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('searchQuery')
->label('Search Term')
->placeholder('Enter your search term')
->required(),
]);
}

public function search(): void
{
$this->validate();

// Here you would implement your Supabase search logic
// Example:
// $this->searchResults = YourSupabaseService::search($this->searchQuery);
}

public function render(): View
{
return view('filament.pages.custom-search');
}
}
10 replies
FFilament
Created by jjo63 on 12/14/2024 in #❓┊help
Building own "resource" to run within the Filament UI
@jjo63 As an experiment, I've put your question into Claude AI and it gave me pretty good answer, pasting it below. Haven't tried it myself but the direction seems pretty good. The general idea is that any custom page in Filament is a Livewire component, so in the Blade file you use things like wire:submit="search" Also as you want to use Filament UI you need to use Filament components such as <x-filament::button type="submit" class="mt-4">
10 replies
FFilament
Created by Lloyd on 12/5/2024 in #❓┊help
TableWidget will not sort with getStateUsing
No description
5 replies