sven
sven
FFilament
Created by sven on 7/22/2024 in #❓┊help
Only allow to edit one record in my resource
Hey! Is it possible to have a filament ressource but skip the view which lists all records and always navigate to the edit-route of a specific record? I tried something like this:
// ProfileResource.php

public static function getPages(): array
{
return [
// I named it index so that it is still
// in the navigation
'index' => Pages\EditProfile::route('/'),
];
}

// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
protected static string $resource = ProfileResource::class;

// I am doing this so the route can be visited without
// providing the ID to the URL
public function mount(): void
{
$this->record = $this->resolveRecord(auth()->user()->profile());

$this->authorizeAccess();

$this->fillForm();

$this->previousUrl = url()->previous();
}
// ProfileResource.php

public static function getPages(): array
{
return [
// I named it index so that it is still
// in the navigation
'index' => Pages\EditProfile::route('/'),
];
}

// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
protected static string $resource = ProfileResource::class;

// I am doing this so the route can be visited without
// providing the ID to the URL
public function mount(): void
{
$this->record = $this->resolveRecord(auth()->user()->profile());

$this->authorizeAccess();

$this->fillForm();

$this->previousUrl = url()->previous();
}
This approach can not work because i am overloading mount with the wrong number of arguments.
5 replies
FFilament
Created by sven on 6/8/2024 in #❓┊help
Best practise for help / documentations?
Hey! I have a manual for my application. Is there a recommended way where to link to it? Some common place for a help-button maybe? I described whole ressources in my manual
3 replies
FFilament
Created by sven on 5/16/2024 in #❓┊help
Keyboard Shortcuts for Wizard
Hey, is there a shortcut or way to assign one to the next / previous-buttons for the wizard? Background: Many backend-users whos job it is to daily use the forms we, developers, are building, prefer to not use the mouse. With simple forms they are used to tabbing, but having a lot of fields in one big form is also not ideal from a UX-perspective.
3 replies
FFilament
Created by sven on 5/16/2024 in #❓┊help
Autocomplete with custom values?
Hey! If I read it correctly, the TextInput still allows custom values, but completes with a predefined array ( https://filamentphp.com/docs/3.x/forms/fields/text-input#autocompleting-text-with-a-datalist ) whereas the selectinput allows compley callbacks for providing the suggestions, but does not allow custom values. Is there something that does both? The TagsInput seems a great fit, but always allow multiple values. I am looking for an autocomplete that accepts a single value, which can also be custom :D
11 replies
FFilament
Created by sven on 4/11/2024 in #❓┊help
How are Plugin Activations counted?
Hey, I would like to buy Advanced Tables. The project site states that one license is for one project, but the checkout states it includes 3 activations (local, ci, prod). If I have a QA-instance or a second developer (second local machine), does that already mean I need unlimited for a single project?
5 replies
FFilament
Created by sven on 3/15/2024 in #❓┊help
Can I use the tenant switcher without tenants?
Hey! I have a system where the main resources are shared between different organizations / passed around. Very rarely does data belong to a single organization. As such I have my own set of access policies and scopes to ensure who can see what. I still would like users to switch between organizations. As the requirements are quite simple on a technical level, the only missing piece for me would be an intuitive UI for the switcher within the sidebar.
4 replies
FFilament
Created by sven on 2/13/2024 in #❓┊help
Specify 'id' col for editpage
I have a resource, which defines a join as part of its getEloquentQuery. Viewing records works just fine, however the EditRecord crashes because it tries to access coloum id instead of foos.id (which is neccessary because of the join). Can I change that behaviour?
4 replies
FFilament
Created by sven on 1/30/2024 in #❓┊help
Option to place introductionary help text on top of ressources?
Hey, I aim for the control panel to be as self-explanatory as possible. Filament does a great job for that with options as helptexts. One thing I can not find though: I want some kind of introtext on top of the listview/create/edit. For example I want to explain what "StripeConnections" are to the user. Is there a default way to do so?
11 replies
FFilament
Created by sven on 1/28/2024 in #❓┊help
Authorize Resouces not via model policies
Hey, I have a Model / Ressource that has two different Filament ressources. One, which is more complex and shows more stuff, intended for admins, and a simple one for other users. viewAny would affect both. So how can control access diferently?
3 replies
FFilament
Created by sven on 12/11/2023 in #❓┊help
MorphMany Relations not (yet) supported in V3 relationshipManager?
Hey! TL/DR The docs state These are compatible with HasMany, HasManyThrough, BelongsToMany, MorphMany and MorphToMany relationships. on https://filamentphp.com/docs/3.x/panels/resources/relation-managers#relation-managers---interactive-tables-underneath-your-resource-forms but when creating a RelationManager for a morphed relation, I receive App\Models\Product::logs(): Return value must be of type Illuminate\Database\Eloquent\Relations\HasMany, Illuminate\Database\Eloquent\Relations\MorphMany returned Detailed example I have a Model Product, which has its own ProductRessource and a model History. In my History I have:
public function logable()
{
return $this->morphTo('logable');
}
public function logable()
{
return $this->morphTo('logable');
}
and in my Product I have
public function logs(): HasMany
{
return $this->morphMany(History::class, 'logable');
}
public function logs(): HasMany
{
return $this->morphMany(History::class, 'logable');
}
In my LogRelationManager I added
class LogRelationManager extends RelationManager
{

protected static string $relationship = 'logs';
class LogRelationManager extends RelationManager
{

protected static string $relationship = 'logs';
But when opening my ProductResource, I receive App\Models\Product::logs(): Return value must be of type Illuminate\Database\Eloquent\Relations\HasMany, Illuminate\Database\Eloquent\Relations\MorphMany returned
3 replies