Created
December 27, 2019 16:43
-
-
Save assertchris/4ac3d01a5e20eb4dce7e5c6afce3c6d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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