📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-02 06:20:55
📂
/ (Root)
/
home
/
orkouolp
/
web
/
testing.orkobd
/
laravel
/
app
/
Http
/
Controllers
/
Frontend
📍 /home/orkouolp/web/testing.orkobd/laravel/app/Http/Controllers/Frontend
🔄 Refresh
✏️
Editing: CandidateEducationController.php
Writable
<?php namespace App\Http\Controllers\frontend; use App\Models\CandidateEducation; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Requests\Frontend\CandidateEducationStoreRequest; class CandidateEducationController extends Controller { /** * Display a listing of the resource. */ public function index() { $candidateEducation = CandidateEducation::where('candidate_id', auth() ->user()->candidateProfile->id)->orderBy('id', 'DESC')->get(); return view('frontend.candidate-dashboard.profile.ajax-education-table', compact('candidateEducation'))->render(); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(CandidateEducationStoreRequest $request) { //dd($request->all()); $education = new CandidateEducation(); $education->candidate_id = auth()->user()->candidateProfile->id; $education->level = $request->level; $education->degree = $request->degree; $education->year = $request->year; $education->note = $request->note; $education->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) { $education = CandidateEducation::findOrFail($id); return response($education); } /** * Update the specified resource in storage. */ public function update(CandidateEducationStoreRequest $request, string $id) { $education = CandidateEducation::findOrFail($id); if($education->candidate_id !== auth()->user()->candidateProfile->id) { abort(404); } $education->level = $request->level; $education->degree = $request->degree; $education->year = $request->year; $education->note = $request->note; $education->save(); return response(['message' => 'Updated Successfully'], 200); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { try { $education = CandidateEducation::findOrFail($id); if($education->candidate_id !== auth()->user()->candidateProfile->id) { abort(404); } $education->delete(); response(['message' => 'Deleted Successfully!'], 200); } catch(\Exception $e) { logger($e); response(['message' => 'Something Went Wrong Please Try Again!'], 500); } } }
💾 Save Changes
❌ Cancel