Arshavir
Arshavir
FFilament
Created by Arshavir on 11/7/2024 in #❓┊help
ToggleButtons are requiring a double-click to change their state
On Edit form i have this issue - ToggleButtons are requiring a double-click to change their state. On Create form it is Ok. What can cause this issue?
27 replies
FFilament
Created by Arshavir on 11/4/2024 in #❓┊help
BelongsToMany Full Name Accessor
I have
public function courses()
{
return $this->belongsToMany(Course::class);
}
public function courses()
{
return $this->belongsToMany(Course::class);
}
in Course Model have
public function getFullNameAttribute()
{
return $this->department->name . ' ' . $this->course . ' ' . __('term');
}
public function getFullNameAttribute()
{
return $this->department->name . ' ' . $this->course . ' ' . __('term');
}
When call Tables\Columns\TextColumn::make('courses.full_name') Getting empty field. How can I solve this?
23 replies
FFilament
Created by Arshavir on 10/10/2024 in #❓┊help
Reorder records only for self group
No description
1 replies
FFilament
Created by Arshavir on 7/23/2024 in #❓┊help
Two Livewire Components
Hi everyone, I'm trying to get from one Livewire Component to another (Livewire Events) But getting new value only second time and value is previous selected. Below will describe more. Here is codes... First Component Class
namespace App\Livewire;

use App\Models\Chair;
use Livewire\Component;

class ListFilters extends Component
{

public $chair;
public $chairDetails;

public function mount(): void
{
$this->chairDetails = Chair::all();
}

public function change()
{
$this->dispatch('chairChanged', $this->chair);
}

....
}
namespace App\Livewire;

use App\Models\Chair;
use Livewire\Component;

class ListFilters extends Component
{

public $chair;
public $chairDetails;

public function mount(): void
{
$this->chairDetails = Chair::all();
}

public function change()
{
$this->dispatch('chairChanged', $this->chair);
}

....
}
First Component View
<div>
<x-filament::section icon="heroicon-o-user" icon-color="info">
<x-slot name="heading">
User details
</x-slot>
<x-slot name="description">
This is all the information we hold about the user.
</x-slot>
<x-filament::input.wrapper>
<x-filament::input.select wire:model="chair" wire:change="change">
<option value="*">Select Option</option>
@foreach ($chairDetails as $chair)
<option value="{{ $chair->id }}">{{ $chair->name }}</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
</x-filament::section>
</div>
<div>
<x-filament::section icon="heroicon-o-user" icon-color="info">
<x-slot name="heading">
User details
</x-slot>
<x-slot name="description">
This is all the information we hold about the user.
</x-slot>
<x-filament::input.wrapper>
<x-filament::input.select wire:model="chair" wire:change="change">
<option value="*">Select Option</option>
@foreach ($chairDetails as $chair)
<option value="{{ $chair->id }}">{{ $chair->name }}</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
</x-filament::section>
</div>
Second Component Class
#[On('chairChanged')]
public function chairChanged($chairId)
{
$this->chairId = (int) $chairId;
}

public function table(Table $table): Table
{
dd($this->chairId);
.....
#[On('chairChanged')]
public function chairChanged($chairId)
{
$this->chairId = (int) $chairId;
}

public function table(Table $table): Table
{
dd($this->chairId);
.....
Second Component View
<x-filament-panels::page>
<livewire:list-filters />
@foreach($questionnaires as $questionnaire)
<livewire:list-reports :questionnaire="$questionnaire->id" :key="$questionnaire->id" />
@endforeach
</x-filament-panels::page>
<x-filament-panels::page>
<livewire:list-filters />
@foreach($questionnaires as $questionnaire)
<livewire:list-reports :questionnaire="$questionnaire->id" :key="$questionnaire->id" />
@endforeach
</x-filament-panels::page>
When select First time - get null Second time - get previous selected value How can I fix this? Thanks
3 replies
FFilament
Created by Arshavir on 7/9/2024 in #❓┊help
Summarising groups
No description
8 replies
FFilament
Created by Arshavir on 6/20/2024 in #❓┊help
If field is disabled, do not require
Is it true, if field is disabled it would be not required (pass validation)? I have toggle, when toggle is on, field becomes disabled, but still required validation don't let me to pass the field.
40 replies
FFilament
Created by Arshavir on 6/20/2024 in #❓┊help
Toggle on Section Header
Hi everyone, is it possible to put Toggle on Section Header like Action button?
3 replies
FFilament
Created by Arshavir on 5/25/2024 in #❓┊help
Form Wizard with substeps and Infolist items
No description
2 replies
FFilament
Created by Arshavir on 5/21/2024 in #❓┊help
ToggleButtons in RelationManager Attach getting Error "Array to string conversion"
When trying to Attach new item with Pivot getting Array to String Error, with Edit working fine. Here are codes: Models
class Group extends Model
{
use HasFactory, SoftDeletes;

protected $fillable = [
'course_id',
'name',
'type',
];

protected $casts = [
'type' => GroupType::class,
'lecturer_type' => 'array',
];

public function course()
{
return $this->belongsTo(Course::class);
}

public function lecturers()
{
return $this->belongsToMany(Lecturer::class)
->withPivot(['lecturer_type']);
}
}
class Group extends Model
{
use HasFactory, SoftDeletes;

protected $fillable = [
'course_id',
'name',
'type',
];

protected $casts = [
'type' => GroupType::class,
'lecturer_type' => 'array',
];

public function course()
{
return $this->belongsTo(Course::class);
}

public function lecturers()
{
return $this->belongsToMany(Lecturer::class)
->withPivot(['lecturer_type']);
}
}
class Lecturer extends Model
{
use HasFactory, SoftDeletes, HasTranslations;

public $translatable = [
'first_name',
'last_name',
'father_name',
'position'
];

protected $fillable = [
'chair_id',
'first_name',
'last_name',
'father_name',
'position',
'photo',
];

public function chair()
{
return $this->belongsTo(Chair::class);
}

public function groups()
{
return $this->belongsToMany(Group::class)
->withPivot(['lecturer_type']);
}
}
class Lecturer extends Model
{
use HasFactory, SoftDeletes, HasTranslations;

public $translatable = [
'first_name',
'last_name',
'father_name',
'position'
];

protected $fillable = [
'chair_id',
'first_name',
'last_name',
'father_name',
'position',
'photo',
];

public function chair()
{
return $this->belongsTo(Chair::class);
}

public function groups()
{
return $this->belongsToMany(Group::class)
->withPivot(['lecturer_type']);
}
}
18 replies
FFilament
Created by Arshavir on 5/15/2024 in #❓┊help
Many-to-Many relationship - get name from third table
No description
49 replies