Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created December 27, 2019 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assertchris/4ac3d01a5e20eb4dce7e5c6afce3c6d1 to your computer and use it in GitHub Desktop.
Save assertchris/4ac3d01a5e20eb4dce7e5c6afce3c6d1 to your computer and use it in GitHub Desktop.
<?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