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,6 +29,14 @@ class Course extends Resource
|
||||
* @var string
|
||||
*/
|
||||
public static $title = 'name';
|
||||
/**
|
||||
* The columns that should be searched.
|
||||
* @var array
|
||||
*/
|
||||
public static $search = [
|
||||
'id',
|
||||
'name',
|
||||
];
|
||||
|
||||
public static function label()
|
||||
{
|
||||
@@ -40,15 +48,6 @@ class Course extends Resource
|
||||
return __('Course');
|
||||
}
|
||||
|
||||
/**
|
||||
* The columns that should be searched.
|
||||
* @var array
|
||||
*/
|
||||
public static $search = [
|
||||
'id',
|
||||
'name',
|
||||
];
|
||||
|
||||
public static function relatableLecturers(NovaRequest $request, $query, Field $field)
|
||||
{
|
||||
if ($field instanceof BelongsTo) {
|
||||
@@ -67,6 +66,11 @@ class Course extends Resource
|
||||
->toString()));
|
||||
}
|
||||
|
||||
public function subtitle()
|
||||
{
|
||||
return __('Erstellt von: :name', ['name' => $this->createdBy->name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields displayed by the resource.
|
||||
*
|
||||
@@ -101,7 +105,7 @@ class Course extends Resource
|
||||
|
||||
BelongsTo::make(__('Lecturer'), 'lecturer', Lecturer::class)
|
||||
->searchable()
|
||||
->help(__('Wähle hier den Dozenten aus, der den Kurs hält. Wenn der Dozent nicht in der Liste ist, dann erstelle ihn zuerst unter "Dozenten".')),
|
||||
->help(__('Wähle hier den Dozenten aus, der den Kurs hält. Wenn der Dozent nicht in der Liste ist, dann erstelle ihn zuerst unter "Dozenten".'))->withSubtitles(),
|
||||
|
||||
SelectPlus::make(__('Categories'), 'categories', Category::class)
|
||||
->usingIndexLabel('name'),
|
||||
@@ -114,7 +118,7 @@ class Course extends Resource
|
||||
return $request->user()
|
||||
->hasRole('super-admin');
|
||||
})
|
||||
->searchable(),
|
||||
->searchable()->withSubtitles(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user