Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created December 27, 2019 16:43
<?php
// ...
class MyComponent extends Component
{
public $dealIds;
public function mount($deals)
{
$this->dealIds = $deals->pluck('id');
}
public function render()
{
$deals = Deal::whereIn('id', $this->dealIds)->get();
return view('my-component', compact('deals'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment