📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-02 02:21:16
📂
/ (Root)
/
home
/
orkouolp
/
web
/
testing.orkobd
/
laravel
/
app
/
Http
/
Controllers
/
Frontend
📍 /home/orkouolp/web/testing.orkobd/laravel/app/Http/Controllers/Frontend
🔄 Refresh
✏️
Editing: CandidateExperienceController.php
Writable
<?php namespace App\Http\Controllers\frontend; use Illuminate\Http\Request; use App\Models\CandidateExperience; use App\Http\Controllers\Controller; use App\Http\Requests\Frontend\CandidateExperienceStoreRequest; class CandidateExperienceController extends Controller { /** * Display a listing of the resource. */ public function index() { $candidateExperiences = CandidateExperience::where('candidate_id', auth() ->user()->candidateProfile->id)->orderBy('id', 'DESC')->get(); return view('frontend.candidate-dashboard.profile.ajax-experience-table', compact('candidateExperiences'))->render(); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(CandidateExperienceStoreRequest $request) { //dd(auth()->user()->candidateProfile); //dd($request->all()); $experience = new CandidateExperience(); $experience->candidate_id = auth()->user()->candidateProfile->id; $experience->company = $request->company; $experience->department = $request->department; $experience->designation = $request->designation; $experience->start = $request->start; $experience->end = $request->end; $experience->currently_working = $request->filled('currently_working')? 1: 0; $experience->responsibilities = $request->responsibilities; $experience->save(); return response(['message' => 'Created Successfully'], 200); } /** * Display the specified resource. */ // public function show(string $id) // { // // // } /** * Show the form for editing the specified resource. */ public function edit(string $id) { $experience = CandidateExperience::findOrFail($id); return response($experience); } /** * Update the specified resource in storage. */ public function update(CandidateExperienceStoreRequest $request, string $id) { $experience = CandidateExperience::findOrFail($id); if($experience->candidate_id !== auth()->user()->candidateProfile->id) { abort(404); } $experience->company = $request->company; $experience->department = $request->department; $experience->designation = $request->designation; $experience->start = $request->start; $experience->end = $request->end; $experience->currently_working = $request->filled('currently_working')? 1: 0; $experience->responsibilities = $request->responsibilities; $experience->save(); return response(['message' => 'Updated Successfully'], 200); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { try { $experience = CandidateExperience::findOrFail($id); if($experience->candidate_id !== auth()->user()->candidateProfile->id) { abort(404); } $experience->delete(); response(['message' => 'Deleted Successfully!'], 200); } catch(\Exception $e) { logger($e); response(['message' => 'Something Went Wrong Please Try Again!'], 500); } } }
💾 Save Changes
❌ Cancel