Skip to content

Instantly share code, notes, and snippets.

@vineeth030
Last active July 4, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vineeth030/486ee8862e954aaeadb96d15ca99ce08 to your computer and use it in GitHub Desktop.
Save vineeth030/486ee8862e954aaeadb96d15ca99ce08 to your computer and use it in GitHub Desktop.
<?php
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make('Title')->sortable(),
Textarea::make('Description'),
Date::make('Created At'),
Boolean::make('Active'),
Select::make('Topic')->options([
'S' => 'Shopping',
'M' => 'Money',
'L' => 'Lifestyle',
])->displayUsingLabels(),
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment