Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use search on secondary table in joining statement? #33

Open
codepoetryindia opened this issue Sep 28, 2020 · 0 comments
Open

Comments

@codepoetryindia
Copy link

public function query()
{
$response = Transaction::latest()->select('transactions.*', 'users.name', 'users.mobile')
->join('users', 'transactions.user_id', 'users.id');
return $response;
}

public function columns()
{
return [
// Column::make('ID')->searchable()->sortable(),
Column::make("Date", 'created_at')->view('livewire.admin.partial.common.date-format')->sortable(),
Column::make('Order No', 'order_id')->searchable()->sortable(),
Column::make('Name', 'name')->searchable('users.name')->sortable(),
Column::make('Amount')->sortable(),
Column::make("Payment", 'payment_status')->view('livewire.admin.partial.common.payment-status'),
Column::make("Service", 'order_status')->view('livewire.admin.partial.common.service-status'),
Column::make()->view('livewire.admin.partial.common.common-action'),
];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant