Skip to content

Instantly share code, notes, and snippets.

@breizhwave
Last active October 13, 2019 16:57
Show Gist options
  • Save breizhwave/0725431c5eb07ccddd54acfda5aa06ba to your computer and use it in GitHub Desktop.
Save breizhwave/0725431c5eb07ccddd54acfda5aa06ba to your computer and use it in GitHub Desktop.
Laravel Nova SearchableSelect linked on index
BelongsTo::make('Product')->rules('required')->hideWhenCreating()->hideWhenUpdating(),
SearchableSelect::make('Product', 'product_id')->resource("products")->loadResourcesOnNew()->displayUsing(function($product) {return $this->product->title ; })->hideFromIndex(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment