mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
library items parent_id
This commit is contained in:
@@ -26,12 +26,6 @@ class Library extends Resource
|
||||
* @var string
|
||||
*/
|
||||
public static $title = 'name';
|
||||
|
||||
public static function label()
|
||||
{
|
||||
return __('Library');
|
||||
}
|
||||
|
||||
/**
|
||||
* The columns that should be searched.
|
||||
* @var array
|
||||
@@ -41,6 +35,15 @@ class Library extends Resource
|
||||
'name',
|
||||
];
|
||||
|
||||
public static $with = [
|
||||
'createdBy',
|
||||
];
|
||||
|
||||
public static function label()
|
||||
{
|
||||
return __('Library');
|
||||
}
|
||||
|
||||
public static function afterCreate(NovaRequest $request, Model $model)
|
||||
{
|
||||
\App\Models\User::find(1)
|
||||
@@ -68,6 +71,10 @@ class Library extends Resource
|
||||
ID::make()
|
||||
->sortable(),
|
||||
|
||||
BelongsTo::make(__('Parent'), 'parent', __CLASS__)
|
||||
->searchable()
|
||||
->nullable(),
|
||||
|
||||
Text::make('Name')
|
||||
->rules('required', 'string'),
|
||||
|
||||
@@ -86,7 +93,8 @@ class Library extends Resource
|
||||
return $request->user()
|
||||
->hasRole('super-admin');
|
||||
})
|
||||
->searchable()->withSubtitles(),
|
||||
->searchable()
|
||||
->withSubtitles(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ class LibraryItem extends Resource
|
||||
'name',
|
||||
];
|
||||
|
||||
public static $with = [
|
||||
'lecturer',
|
||||
'tags',
|
||||
];
|
||||
|
||||
public static function label()
|
||||
{
|
||||
return __('Library Item');
|
||||
|
||||
Reference in New Issue
Block a user