mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
->withSubtitles() added
This commit is contained in:
@@ -29,17 +29,6 @@ class CourseEvent extends Resource
|
||||
'course.name',
|
||||
];
|
||||
|
||||
public static function relatableCourses(NovaRequest $request, $query, Field $field)
|
||||
{
|
||||
if ($field instanceof BelongsTo) {
|
||||
$query->whereHas('lecturer', function ($query) use ($request) {
|
||||
$query->where('team_id', $request->user()->id);
|
||||
});
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function title()
|
||||
{
|
||||
return $this->from.' - '.$this->venue->name.' - '.$this->course->name;
|
||||
@@ -59,6 +48,11 @@ class CourseEvent extends Resource
|
||||
->toString()));
|
||||
}
|
||||
|
||||
public function subtitle()
|
||||
{
|
||||
return __('Erstellt von: :name', ['name' => $this->createdBy->name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields displayed by the resource.
|
||||
*
|
||||
@@ -85,17 +79,18 @@ class CourseEvent extends Resource
|
||||
->rules('required')
|
||||
->displayUsing(fn($value) => $value->asDateTime()),
|
||||
|
||||
BelongsTo::make(__('Course'), 'course', Course::class),
|
||||
BelongsTo::make(__('Course'), 'course', Course::class)
|
||||
->searchable()->showCreateRelationButton()->withSubtitles(),
|
||||
|
||||
BelongsTo::make(__('Venue'), 'venue', Venue::class)
|
||||
->searchable(),
|
||||
->searchable()->showCreateRelationButton()->withSubtitles(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->canSee(function ($request) {
|
||||
return $request->user()
|
||||
->hasRole('super-admin');
|
||||
})
|
||||
->searchable(),
|
||||
->searchable()->withSubtitles(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user