Provides a capability of auto-completed searching resource.
Based on Vue-multiselect
You can install this Laravel Nova field via composer:
composer require mikaelpopowicz/nova-vue-select
// in your Nova Resource
VueSelect('Field label', 'attribute', OtherResource::class),
Create a Nova filter and make it inherit from VueSelectFilter. You may override constructor to set the Resource you want to fetch.
<?php
namespace App\Nova\Filters;
use App\Nova\User;
use Illuminate\Http\Request;
use Mikaelpopowicz\NovaVueSelect\VueSelectFilter;
class UserFilter extends VueSelectFilter
{
public function __construct()
{
parent::__construct(User::class);
}
public function apply(Request $request, $query, $value)
{
return $query->where('user_id', '=', $value);
}
}