*/ public static $model = \App\Models\Post\User\UserDoc::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 = [ 'id', ]; /** * Return the location to redirect the user after creation. * * @param \Laravel\Nova\Resource $resource * @return \Laravel\Nova\URL|string */ public static function redirectAfterCreate(NovaRequest $request, $resource) { return sprintf('/resources/users/%s', $resource->user_id); } /** * Return the location to redirect the user after update. * * @param \Laravel\Nova\Resource $resource * @return \Laravel\Nova\URL|string */ public static function redirectAfterUpdate(NovaRequest $request, $resource) { return sprintf('/resources/users/%s', $resource->user_id); } /** * Get the fields displayed by the resource. * * @return array */ public function fields(NovaRequest $request) { return [ ID::make()->sortable(), BelongsTo::make(__('User'), 'user', User::class), Select::make(__('Type'), 'corporation_type') ->options(UserDoc::corparationTypes()) ->rules('required') ->displayUsingLabels(), Text::make(__('Name'), 'corporation_name')->rules('required'), Image::make(__('Patent'), 'patent_data') ->deletable(false) ->creationRules('required'), Images::make(__('Goşmaça'), 'main') ->conversionOnIndexView('thumb150x150') ->setFileName(NovaForm::hashFileName()), ]; } /** * Get the cards available for the request. * * @return array */ public function cards(NovaRequest $request) { return []; } /** * Get the filters available for the resource. * * @return array */ public function filters(NovaRequest $request) { return []; } /** * Get the lenses available for the resource. * * @return array */ public function lenses(NovaRequest $request) { return []; } /** * Get the actions available for the resource. * * @return array */ public function actions(NovaRequest $request) { return []; } }