adds roles
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
use Laravel\Nova\Fields\BelongsTo;
|
||||
use Laravel\Nova\Fields\Boolean;
|
||||
use Laravel\Nova\Fields\DateTime;
|
||||
use Laravel\Nova\Fields\HasMany;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\Number;
|
||||
use Laravel\Nova\Fields\Text;
|
||||
@@ -51,6 +52,22 @@ final class QuestionResource extends Resource
|
||||
*/
|
||||
public static $group = 'Questionnaire';
|
||||
|
||||
/**
|
||||
* Get the displayable label of the resource.
|
||||
*/
|
||||
public static function label(): string
|
||||
{
|
||||
return 'Questions';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the displayable singular label of the resource.
|
||||
*/
|
||||
public static function singularLabel(): string
|
||||
{
|
||||
return 'Question';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields displayed by the resource.
|
||||
*
|
||||
@@ -111,6 +128,8 @@ public function fields(NovaRequest $request): array
|
||||
->exceptOnForms()
|
||||
->sortable()
|
||||
->filterable(),
|
||||
|
||||
HasMany::make('Answers', 'answers', AnswerResource::class),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user