// in your Nova resource
public function fields(Request $request)
{
return [
// ...
Tags::make('Tags')->type('my-special-type'),
// ...
];
}
// in your Nova resource
public function fields(Request $request)
{
return [
// ...
Tags::make('Tags')->single(),
// ...
];
}
// in your Nova resource
public function fields(Request $request)
{
return [
// ...
Tags::make('Tags')->single()->canBeDeselected(),
// ...
];
}
// in your Nova resource
public function fields(Request $request)
{
return [
// ...
Tags::make('Categories', 'tags')->withMeta(['placeholder' => 'Add categories...']),
// ...
];
}
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Spatie\Tags\Tag as TagModel;
class Tag extends Resource
{
public static $model = TagModel::class;
public static $title = 'name';
public static $search = [
'name',
];
public function fields(Request $request)
{
return [
Text::make('Name')->sortable(),
];
}
}
Tags::make('Tags')->withLinkToTagResource() // The resource App\Nova\Tag will be used
Tags::make('Tags')->withLinkToTagResource(\Custom\CustomTag::class) // The resource \Custom\CustomTag will be used
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.