/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array
*/
public function tools()
{
return [
\Rjvandoesburg\NovaUrlRewrite\NovaUrlRewriteTool::make(),
];
}
$product = \App\Models\Product::find(5);
$builder->requestPath('/apple-airpods')
->unique()
->model($product);
// Because no target_path was provided the builder will look at the provided model/resource and generates a url based on their names.
$urlRewrite = $repository->create($builder);
$product = \App\Models\Product::find(5);
$resource = new \App\Nova\Product($product);
$builder->requestPath('/apple-airpods')
->group(0) // Defaults to 0
->resource($resource)
->unique()
->redirectType(\Rjvandoesburg\NovaUrlRewrite\Models\UrlRewrite::FORWARD)
->model($product) // This is redundant as the model is bound to the resource
->description('Landing page for the NEW apple airpods');
$urlRewrite = $repository->create($builder);