Skip to content

Instantly share code, notes, and snippets.

@adrelliott
Created November 19, 2021 07:59
Show Gist options
  • Save adrelliott/c7799b5d3d9eaf060758b99faba7976d to your computer and use it in GitHub Desktop.
Save adrelliott/c7799b5d3d9eaf060758b99faba7976d to your computer and use it in GitHub Desktop.
// ContactsController.php
public function index(Company $company)
{
$query = Contact::where('company_id', $company->id);
return view('crm.contacts.index', compact('query'));
}
// Livewire/TableComponent.php
public function mount(Builder $query)
{
$this->query = $query;
}
protected function getTableQuery(): Builder
{
return $this->query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment