Yuvraj Timalsina
Yuvraj Timalsina
FFilament
Created by Yuvraj Timalsina on 6/13/2024 in #❓┊help
Wizard Step did not auto scroll to reveal heading only its active state and form changed.
No description
2 replies
FFilament
Created by Yuvraj Timalsina on 6/12/2024 in #❓┊help
Call to a member function associate() on null
Student
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
EnglishExam
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
StudentResource
Repeater::make('englishExams')
->relationship()
->schema([
Select::make('english_exam_id')
->label('English Exam')
->options(EnglishExam::all()->pluck('title', 'id'))
->required(),
TextInput::make('speaking_score')
->label('Speaking Score')
->numeric()
->required(),
TextInput::make('reading_score')
->label('Reading Score')
->numeric()
->required(),
TextInput::make('writing_score')
->label('Writing Score')
->numeric()
->required(),
])
->columns(4)
->label('English Exams'),
Repeater::make('englishExams')
->relationship()
->schema([
Select::make('english_exam_id')
->label('English Exam')
->options(EnglishExam::all()->pluck('title', 'id'))
->required(),
TextInput::make('speaking_score')
->label('Speaking Score')
->numeric()
->required(),
TextInput::make('reading_score')
->label('Reading Score')
->numeric()
->required(),
TextInput::make('writing_score')
->label('Writing Score')
->numeric()
->required(),
])
->columns(4)
->label('English Exams'),
I get "Call to a member function associate() on null"
2 replies
FFilament
Created by Yuvraj Timalsina on 4/7/2024 in #❓┊help
How to pass parameter to custom middleware?
->authMiddleware([
Authenticate::class,
CheckRole::class,
]);
->authMiddleware([
Authenticate::class,
CheckRole::class,
]);
How do i pass parameter to CheckRole::class in AdminPanelProvider filamentphp?
public function handle(Request $request, Closure $next, Role $requiredRole): Response
{
$userRole = $request->user()->role;

if ($userRole !== $requiredRole) {
$selfPanelRoute = Filament::getPanel($userRole->value)->getId();

return redirect($selfPanelRoute);
}

return $next($request);
}
public function handle(Request $request, Closure $next, Role $requiredRole): Response
{
$userRole = $request->user()->role;

if ($userRole !== $requiredRole) {
$selfPanelRoute = Filament::getPanel($userRole->value)->getId();

return redirect($selfPanelRoute);
}

return $next($request);
}
2 replies
FFilament
Created by Yuvraj Timalsina on 9/24/2023 in #❓┊help
How do I add requiresConfirmation to ToggleColumn and SelectColumn in Table?
Is there a way to add requiresConfirmation modal in these columns?
Tables\Columns\ToggleColumn::make('status'),
Tables\Columns\SelectColumn::make('category_id')
Tables\Columns\ToggleColumn::make('status'),
Tables\Columns\SelectColumn::make('category_id')
8 replies