malivodka
malivodka
FFilament
Created by malivodka on 8/18/2024 in #❓┊help
The export modal only shows 1 column
No description
3 replies
FFilament
Created by malivodka on 8/4/2024 in #❓┊help
is there a way to manage relations in infolist entry?
I cant find any relationship related on infolist docs.. and when debugging my entry. it seems that relationship is not showing.. even if I am sure that I have relationships data.. is this expected? or I messed up?
3 replies
FFilament
Created by malivodka on 4/29/2024 in #❓┊help
How to hide drop down on menus?
No description
4 replies
FFilament
Created by malivodka on 3/24/2024 in #❓┊help
Is it possible to display hasMany relations into the view action?
I have this livewire component..
<?php

namespace App\Livewire;

use App\Models\Role;
use App\Services\RolesAndPermissionService;
use Filament\Tables\Actions\EditAction;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;
use Filament\Tables;
use Filament\Forms;

class RolesAndPermissions extends Component implements HasTable, HasForms
{
use InteractsWithTable, InteractsWithForms;

public function render()
{
return view('livewire.roles-and-permissions');
}

public function table(Table $table): Table
{
return $table
->query(Role::query())
->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('label'),
])
->actions([
Tables\Actions\ViewAction::make()
->slideOver()
->form(RolesAndPermissionService::schema()),
EditAction::make()
->slideOver()
->form(RolesAndPermissionService::schema()),
Tables\Actions\DeleteAction::make()
])
->headerActions([
Tables\Actions\CreateAction::make()
->slideOver()
->model(Role::class)
->form(RolesAndPermissionService::schema())
]);
}
}
<?php

namespace App\Livewire;

use App\Models\Role;
use App\Services\RolesAndPermissionService;
use Filament\Tables\Actions\EditAction;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;
use Filament\Tables;
use Filament\Forms;

class RolesAndPermissions extends Component implements HasTable, HasForms
{
use InteractsWithTable, InteractsWithForms;

public function render()
{
return view('livewire.roles-and-permissions');
}

public function table(Table $table): Table
{
return $table
->query(Role::query())
->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('label'),
])
->actions([
Tables\Actions\ViewAction::make()
->slideOver()
->form(RolesAndPermissionService::schema()),
EditAction::make()
->slideOver()
->form(RolesAndPermissionService::schema()),
Tables\Actions\DeleteAction::make()
])
->headerActions([
Tables\Actions\CreateAction::make()
->slideOver()
->model(Role::class)
->form(RolesAndPermissionService::schema())
]);
}
}
on this component you see that I set an ViewAction as slideOver.. Is it possible to add all the relations of the item? Lets say that the role has many permissions and I want to list all permissions of that role.
1 replies
FFilament
Created by malivodka on 3/21/2024 in #❓┊help
new Resource not working after setting up multi-tenancy..
I have a users table and organizations table. they have a many to many relationship and I setup multi-tenancy with the organizations table as a tenant.. I also have roles table that is related to users.. but when I try to setup a new resource for the roles.. I got this errors when I navigate to the page localhost/app/tenant/roles
The model [App\Models\Role] does not have a relationship named [organizations]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [App\Filament\Resources\RoleResource] resource class.
The model [App\Models\Role] does not have a relationship named [organizations]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [App\Filament\Resources\RoleResource] resource class.
3 replies