fork download
  1. <?php
  2.  
  3. $prices = Price::query()
  4. ->with('device')
  5. ->when(request('column', 'name'), function ($q) {
  6. $q->whereHas('device', function ($q) {
  7. $q->orderBy(request('column', 'name'), request('direction', 'desc'));
  8. });
  9. })
  10. ->paginate();
Runtime error #stdin #stdout #stderr 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Class 'Price' not found in /home/8DhJ7M/prog.php:3
Stack trace:
#0 {main}
  thrown in /home/8DhJ7M/prog.php on line 3