📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-02 02:22:09
📂
/ (Root)
/
home
/
orkouolp
/
web
/
testing.orkobd
/
laravel
/
app
/
Http
/
Controllers
/
Admin
📍 /home/orkouolp/web/testing.orkobd/laravel/app/Http/Controllers/Admin
🔄 Refresh
✏️
Editing: IndustryTypeController.php
Writable
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\IndustryType; use App\Services\Notify; use App\Traits\Searchable; use Illuminate\Http\Request; class IndustryTypeController extends Controller { use Searchable; /** * Display a listing of the resource. */ public function index(Request $request) { //dd(request('search')); // $industryTypes = IndustryType::paginate(20); $query = IndustryType::query(); $this->search($query, ['name']); $industryTypes = $query->paginate(20); //1 return view('admin.industry-type.index', compact('industryTypes')); } /** * Show the form for creating a new resource. */ public function create() { return view('admin.industry-type.create'); } /** * Store a newly created resource in storage. */ public function store(Request $request) { //dd($request->all()); $request->validate([ 'name' => ['required', 'max:255', 'unique:industry_types,name'] ]); $type = new IndustryType(); $type->name = $request->name; $type->save(); Notify::createdNotification(); return to_route('admin.industry-types.index'); } /** * Display the specified resource. */ public function show(string $id) { // } /** * Show the form for editing the specified resource. */ public function edit(string $id) { $industryType = IndustryType::findOrFail($id); return view('admin.industry-type.edit', compact('industryType')); } /** * Update the specified resource in storage. */ public function update(Request $request, string $id) { $request->validate([ 'name' => ['required', 'max:255', 'unique:industry_types,name,'.$id] ]); $type = IndustryType::findOrFail($id); $type->name = $request->name; $type->save(); Notify::updatedNotification(); return to_route('admin.industry-types.index'); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { //dd($id); try { IndustryType::findOrFail($id)->delete(); //100 Notify::deletedNotification(); response(['message' => 'success'], 200); } catch(\Exception $e) { logger($e); response(['message' => 'Something Went Wrong Please Try Again!'], 500); } } }
💾 Save Changes
❌ Cancel