*/ public static $model = \Atom\Core\Models\Guild::class; /** * The single value that should be used to represent the resource when being displayed. * * @var string */ public static $title = 'name'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'name', 'description', ]; /** * Get the fields displayed by the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function fields(NovaRequest $request) { return [ Text::make('Name') ->sortable(), Textarea::make('Description') ->onlyOnDetail(), BelongsTo::make('User', 'owner', User::class) ->sortable(), BelongsTo::make('Room', 'room', Room::class) ->sortable(), Number::make('State') ->onlyOnDetail(), Boolean::make('Rights') ->onlyOnDetail(), Boolean::make('Forum'), Text::make('Color One') ->onlyOnDetail(), Text::make('Color Two') ->onlyOnDetail(), Text::make('Badge') ->onlyOnDetail(), Select::make('Read Forum') ->hideFromIndex() ->options(['EVERYONE' => 'Everyone','MEMBERS' => 'Members','ADMINS' => 'Admins']) ->displayUsingLabels(), Select::make('Post Messages') ->hideFromIndex() ->options(['EVERYONE' => 'Everyone','MEMBERS' => 'Members','ADMINS' => 'Admins', 'OWNER' => 'Owner']) ->displayUsingLabels(), Select::make('Post Threads') ->hideFromIndex() ->options(['EVERYONE' => 'Everyone','MEMBERS' => 'Members','ADMINS' => 'Admins', 'OWNER' => 'Owner']) ->displayUsingLabels(), Select::make('Mod Forum') ->hideFromIndex() ->options(['EVERYONE' => 'Everyone','MEMBERS' => 'Members','ADMINS' => 'Admins', 'OWNER' => 'Owner']) ->displayUsingLabels(), Date::make('Date Created') ->displayUsing(fn ($value) => $value ? Carbon::createFromTimestamp($value)->format('Y-m-d H:i:s') : null), ]; } /** * Get the cards available for the request. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function cards(NovaRequest $request) { return []; } /** * Get the filters available for the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function filters(NovaRequest $request) { return []; } /** * Get the lenses available for the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function lenses(NovaRequest $request) { return []; } /** * Get the actions available for the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function actions(NovaRequest $request) { return []; } }