© 2026 Hedgehog Software, LLC
it('can create', function () { $tags = Tag::factory()->count(6)->create(); $newData = Post::factory()->make(); livewire(PostResource\Pages\CreatePost::class) ->fillForm([ 'tags' => $tags->keys(), 'title' => $newData->title, // other fields ... ]) ->call('create') // $this->assertDatabaseHas(...); });
Forms\Components\Select::make('tags') ->relationship('tags', 'name') ->multiple() ->preload()