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 to use sortable inside of a query done inside controller. #197

Open
JYvman opened this issue Mar 25, 2022 · 1 comment
Open

How to use sortable inside of a query done inside controller. #197

JYvman opened this issue Mar 25, 2022 · 1 comment

Comments

@JYvman
Copy link

JYvman commented Mar 25, 2022

Right now, I use a query to display data into a table, so I dont have a model for it. How can I use sortable in this case?

$trainings = Training::sortable()->paginate(8);

    $managers = DB::table('trainingdata')
        ->select('staffName','staff_id','trainer','programTitle','trainingDate','hours','reportingTo')
        ->where('staffName', $username)
        ->orWhere('reportingTo', $username)
        ->get();

    $employees = Training::sortable()
        ->where('staffName', $username)
        ->paginate(8);

$managers is using a query, how do I solve this?

@dhanyn10
Copy link

dhanyn10 commented Apr 6, 2022

sorry, are you want to use sortable and search together?

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

2 participants