⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
dnc
/
@core
/
app
/
Http
/
Controllers
/
View File Name :
HowItWorksController.php
<?php namespace App\Http\Controllers; use App\HowItWork; use App\Language; use Illuminate\Http\Request; class HowItWorksController extends Controller { public function __construct() { $this->middleware('auth:admin'); } public function index() { $all_languages = Language::all(); $all_works = HowItWork::all()->groupBy('lang'); return view('backend.pages.how-it-works-section')->with([ 'all_works' => $all_works, 'all_languages' => $all_languages ]); } public function store(Request $request) { $this->validate($request, [ 'title' => 'required|string|max:191', 'description' => 'required|string', 'lang' => 'required|string', ]); HowItWork::create($request->all()); return redirect()->back()->with(['msg' => __('New Item Added...'), 'type' => 'success']); } public function update(Request $request) { $this->validate($request, [ 'title' => 'required|string|max:191', 'description' => 'required|string', 'lang' => 'required|string', ]); HowItWork::find($request->id)->update($request->all()); return redirect()->back()->with(['msg' => __('Item Updated...'), 'type' => 'success']); } public function delete($id) { HowItWork::find($id)->delete(); return redirect()->back()->with(['msg' => __('Delete Success...'), 'type' => 'danger']); } public function bulk_action(Request $request) { $all = HowItWork::find($request->ids); foreach ($all as $item) { $item->delete(); } return response()->json(['status' => 'ok']); } }