*/ public static $model = StoryModel::class; /** * The single value that should be used to represent the resource when being displayed. * * @var string */ public static $title = 'id'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'title', ]; /** * The relationships that should be eager loaded on index queries. * * @var array */ public static $with = ['media']; /** * Get the displayable label of the resource. */ public static function label(): string { return __('Stories'); } /** * Get the displayable singular label of the resource. */ public static function singularLabel(): string { return __('Story'); } /** * Get the fields displayed by the resource. */ public function fields(NovaRequest $request): array { return [ new Panel(__('Basic information'), [ ID::make()->sortable(), Images::make(__('Photo'), 'photo') ->conversionOnIndexView('thumb200x200') ->rules('required') ->required(), Text::make(__('Title'), 'title') ->rules('required') ->translatable(), DateTime::make(__('Expires at'), 'expires_at') ->default(now()->addDay()) ->nullable() ->rules('nullable', 'date') ->help(__('Default is 24 hours from creation. Set a specific date and hour to control when the story disappears from the mobile app.')), NovaSwitcher::make(__('Visible'), 'is_visible') ->default(true) ->sortable(), ]), ]; } /** * Get the cards available for the request. */ public function cards(NovaRequest $request): array { return []; } /** * Get the filters available for the resource. */ public function filters(NovaRequest $request): array { return [ new VisableFilter(), ]; } /** * Get the lenses available for the resource. */ public function lenses(NovaRequest $request): array { return []; } /** * Get the actions available for the resource. */ public function actions(NovaRequest $request): array { return []; } }