Update default post status to published and enforce unique group names
This commit is contained in:
@@ -40,6 +40,7 @@ class EducationalGroupResource extends Resource
|
||||
->required()
|
||||
->maxLength(50)
|
||||
->placeholder('Например: ИВТ-21-1')
|
||||
->unique()
|
||||
->helperText('Введите краткое название группы в принятом формате'),
|
||||
|
||||
Select::make('faculty_id')
|
||||
|
||||
@@ -96,7 +96,7 @@ class SlidesRelationManager extends RelationManager
|
||||
})
|
||||
->options(function (Forms\Get $get) {
|
||||
if ($get('model_select') === 'Post') {
|
||||
return Post::where('status', 'published')->pluck('title', 'id');
|
||||
return Post::where('status', 'published')->orderBy('created_at', 'desc')->pluck('title', 'id');
|
||||
}
|
||||
if ($get('model_select') === 'Page') {
|
||||
return Page::whereNotNull('title')->pluck('title', 'id');
|
||||
|
||||
Reference in New Issue
Block a user