Blame view

app/Http/Controllers/Admin/EmployersController.php 669 Bytes
8de035475   Андрей Ларионов   Создание: Структу...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  <?php
  
  namespace App\Http\Controllers\Admin;
  
  use App\Http\Controllers\Controller;
  use App\Models\User;
  use Illuminate\Http\Request;
  
  class EmployersController extends Controller
  {
      public function index(Request $request) {
          if ($request->ajax()) {
              $user = User::find($request->id);
              $request->offsetUnset('id');
              $user->update($request->all());
          }
  
          $users = User::where('is_worker', '0')->paginate(15);
          if ($request->ajax()) {
              return view('admin.employer.index_ajax', compact('users'));
          } else {
              return view('admin.employer.index', compact('users'));
          }
      }
  }