Файловый менеджер - Редактировать - /home/clickysoft/public_html/benchexc.clickysoft.net/app/Repositories/Admin/IndustryRepository.php
Назад
<?php namespace App\Repositories\Admin; use App\Interfaces\Admin\IndustryRepositoryInterface; use App\Models\Industry; use Yajra\DataTables\Facades\DataTables; class IndustryRepository implements IndustryRepositoryInterface { public function getDataTable() { $query = Industry::query(); 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%"); if (strtolower($search) === "unverified") { $w->orWhere('is_verified', 0); } elseif (strtolower($search) === "verified") { $w->orWhere('is_verified', 1); } }); } }) ->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>'; })->rawColumns(['is_active', 'action'])->make(true); } public function create($request) { Industry::create([ 'industry_name'=>$request->input('industry_name'), ]); return redirect()->route('industry')->with('success_msg', 'Industry successfully added.'); } public function update($request,$id) { $industry = Industry::where('id',$id)->first(); $industry->update([ 'industry_name'=>$request->input('industry_name'), ]); return redirect()->route('industry')->with('success_msg', 'industry successfully updated.'); } public function destroy($id) { $industry = Industry::where('id',$id)->first(); $industry->delete(); return redirect()->back()->with('success_msg', 'industry successfully delete.'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка