Файловый менеджер - Редактировать - /home/clickysoft/public_html/benchexc.clickysoft.net/app/Repositories/Admin/NeededTalentResourceRepository.php
Назад
<?php namespace App\Repositories\Admin; use App\Interfaces\Admin\NeededTalentResourceRepositoryInterface; use App\Models\NeededTalent; use Yajra\DataTables\Facades\DataTables; class NeededTalentResourceRepository implements NeededTalentResourceRepositoryInterface { public function getDataTable() { $query = NeededTalent::query(); // $query = User::where('id', '!=', Auth::id()); return Datatables::of($query) ->filter(function ($instance) { $search = request('search')['value']; if (!empty($search)) { $instance->where(function ($w) use ($search) { $w->orWhere('industry_name', 'LIKE', "%$search%"); // ->orWhere('Skills', 'LIKE', "%$search%"); if (strtolower($search) === "unverified") { $w->orWhere('is_verified', 0); } elseif (strtolower($search) === "verified") { $w->orWhere('is_verified', 1); } }); } }) ->editColumn('status', function ($obj) { $isChecked = $obj->status == 1 ? "checked" : ""; // Check if status is active (1) $switchBtn = '<label class="switch switch-success"> <input type="checkbox" class="switch-input" '.$isChecked.' onclick="changeStatus(`'.route('resource.status-update', $obj->id).'`)" /> <span class="switch-toggle-slider"> <span class="switch-on"> <i class="bx bx-check"></i> </span> <span class="switch-off"> <i class="bx bx-x"></i> </span> </span> </label>'; return $switchBtn; }) ->addColumn('Skills',function ($obj){ return $obj->multiTechStack->techStack->Skills ?? null; }) ->addColumn('technologies',function ($obj){ return $obj->multiTechStack->techStack->technologies ?? null; })->rawColumns(['is_active', 'action','status']) ->editColumn('mobilization_time', function ($obj) { return !empty($obj->mobilization_time) ? 'yes' : 'no'; }) ->editColumn('onsite_availability', function ($obj) { return !empty($obj->onsite_availability) ? 'yes' : 'no'; })->make(true); // ->addColumn('action', function ($obj) { // $buttons = ' <a class="btn btn-primary redirect-btn" href="' . route('industry.update', $obj->id) . '">Update</a>'; // // return $buttons . ' <button class="btn btn-danger redirect-btn" onclick="deleteData(`' . route('industry.destroy', $obj->id) . '`)">Delete</button>'; // }) } public function updateStatus($request,$id) { $resource = NeededTalent::findOrFail($id); $resource->status = $request->status; $resource->save(); return response()->json([ 'message' => 'Resource status successfully updated.', 'status' => $resource->status ]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка