justaspark
justaspark
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Within the UserRelationManager
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I already have a model
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I scanned all of my project files, and I have never used User::user()
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I get this error
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
It crashes
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I tried using Global Search
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Aww I see, thanks for the suggestion though! Super appreciate it :)))
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I only followed the Relationship Manager docs on Filament
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
I use it an a page called Projects, where you can attach Users to it. Hmm, I don't think I specified a column name for the attach system
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Nada 😦 still "user" instead of the name of the user
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
3rd half:
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
]);
}

public static function getRelations(): array
{
return [
RelationManagers\ProjectsRelationManager::class,
];
}


public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}

public static function getRecordLabel($record): string
{
return $record->name; // Replace 'name' with the actual attribute you want to use for the label.
}

}
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
]);
}

public static function getRelations(): array
{
return [
RelationManagers\ProjectsRelationManager::class,
];
}


public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}

public static function getRecordLabel($record): string
{
return $record->name; // Replace 'name' with the actual attribute you want to use for the label.
}

}
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
2nd half:
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('email')
->searchable(),
Tables\Columns\TextColumn::make('email_verified_at')
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('phone')
->searchable(),
Tables\Columns\TextColumn::make('date_of_birth')
->date()
->sortable(),
Tables\Columns\TextColumn::make('type')
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('email')
->searchable(),
Tables\Columns\TextColumn::make('email_verified_at')
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('phone')
->searchable(),
Tables\Columns\TextColumn::make('date_of_birth')
->date()
->sortable(),
Tables\Columns\TextColumn::make('type')
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Et voila. (thanks for helping out btw!)
<?php

namespace App\Filament\Resources;

use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use App\Models\User;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
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-rectangle-stack';

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),
Forms\Components\TextInput::make('phone')
->tel()
->maxLength(255),
Forms\Components\DatePicker::make('date_of_birth'),
Forms\Components\TextInput::make('type')
->required()
->maxLength(255)
->default('staff'),
]);
}
<?php

namespace App\Filament\Resources;

use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use App\Models\User;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
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-rectangle-stack';

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),
Forms\Components\TextInput::make('phone')
->tel()
->maxLength(255),
Forms\Components\DatePicker::make('date_of_birth'),
Forms\Components\TextInput::make('type')
->required()
->maxLength(255)
->default('staff'),
]);
}
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Hmm, haven't done anything for search columns
32 replies
FFilament
Created by justaspark on 8/3/2023 in #❓┊help
Records in Attachment Dialog only show table name, not record name
Hey! Let me check
32 replies