Jump to content
Fórum Script Brasil
  • 0

como adicionar nome na coluna das Acoes usando filament?


Fabio umpierre

Question

Boa tarde pessoa, tudo certo? espero que sim

bom, eu fazendo um projetinho com laravel, mas na parte de estilizar algumas coisas eu estou me perdendo, já to a 5 dias direto tentando mas não consigo, já tentei a doc oficial, youtube, forums, stack overflow e tb programar junto com o chatGpt, dai resolvi perguntar aqui porque realmente, minhas opcoes esgotaram.

sobre o projeto eu tenho essa tela
image.thumb.png.c9d0f5eb91efe798edf914003e19d01e.png

 

eu queria poder tirar o nome edit do lado dos 3 pontinhos e colocar como nome da coluna, mas não estou conseguindo, eu tb queria colocar um icone do lado de cada nome da coluna, tb queria por um filtro por data, onde aparecesse um calendario. enfim, meu problema esta sendo estilizar as coisas e algumas funcionalidades, eu vou passar uma outra tela, mostrando como eu queria que ficasse logo abaixo, lembrando que eu não estou usando css, html e etc, estou usando apenas o Filament.
image.png.92825e2d8b6c124798717cdd6715a8c9.png

 

vou passar aqui tb o meu arquivo UserResource, que e o arquivo que constroi a primeira tela:

UserResource
 

<?php

namespace App\Filament\Resources;


use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use Filament\Tables\Actions\ActionGroup;
use Filament\Tables\Actions\EditAction;
use App\Models\User;
use Filament\Tables\Actions\Position;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\Resource;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class UserResource extends Resource
{
    protected static ?string $model = User::class;

    protected static ?string $navigationIcon = 'heroicon-o-collection';

    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('name')
                    ->required()
                    ->maxLength(255),
                Forms\Components\TextInput::make('email')
                    ->email()
                    ->required()
                    ->maxLength(255),
                Forms\Components\DateTimePicker::make('email_verified_at'),
                Forms\Components\TextInput::make('password')
                    ->password()
                    ->required()
                    ->maxLength(255),
            ]);
    }

    public static function table(Table $table): Table
    {
        return $table
            ->columns([

                Tables\Columns\TextColumn::make('name'),
                Tables\Columns\TextColumn::make('email'),
                Tables\Columns\TextColumn::make('email_verified_at')
                    ->dateTime(),
                Tables\Columns\TextColumn::make('created_at')
                    ->dateTime(),
                Tables\Columns\TextColumn::make('updated_at')
                    ->dateTime(),
               






            ])
            ->filters([
                //

            ])
            ->actions([

                EditAction::make('Editar'),
                Tables\Actions\DeleteAction::make(),
            ])

            ->bulkActions([
                Tables\Actions\DeleteBulkAction::make(),
            ]);
    }
    protected function getTableActions(): array
    {
        return [
            Tables\Actions\ActionGroup::make([
                Tables\Actions\ViewAction::make(),
                Tables\Actions\EditAction::make('edit', 'Editar'),
                Tables\Actions\DeleteAction::make(),
            ])->dropdown(),
        ];
    }
    protected function getTableActionsPosition(): ?string
    {
        return Position::BeforeCells;
    }

    public static function getPages(): array
    {
        return [
            'index' => Pages\ManageUsers::route('/'),
        ];
    }
}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...